6426 "retrieve a windows system color. |
6426 "retrieve a windows system color. |
6427 The styleSheet/View classes may use this to setup default colors" |
6427 The styleSheet/View classes may use this to setup default colors" |
6428 |
6428 |
6429 |rgb| |
6429 |rgb| |
6430 |
6430 |
6431 rgb := self primGetSystemColor:aKey. |
6431 %{ |
6432 rgb notNil ifTrue:[ |
6432 int p; |
6433 ^ Color |
6433 int __rgb, r, g, b; |
6434 redByte:((rgb bitShift:-16) bitAnd:16rFF) |
6434 |
6435 greenByte:((rgb bitShift:-8) bitAnd:16rFF) |
6435 if (aKey == @symbol(COLOR_WINDOW)) { |
6436 blueByte:(rgb bitAnd:16rFF) |
6436 p = COLOR_WINDOW; |
6437 ]. |
6437 } else if (aKey == @symbol(COLOR_WINDOWTEXT)) { |
6438 ^ nil |
6438 p = COLOR_WINDOWTEXT; |
|
6439 } else if (aKey == @symbol(COLOR_MENU)) { |
|
6440 p = COLOR_MENU; |
|
6441 } else if (aKey == @symbol(COLOR_MENUTEXT)) { |
|
6442 p = COLOR_MENUTEXT; |
|
6443 } else if (aKey == @symbol(COLOR_BTNFACE)) { |
|
6444 p = COLOR_BTNFACE; |
|
6445 } else if (aKey == @symbol(COLOR_BTNSHADOW)) { |
|
6446 p = COLOR_BTNSHADOW; |
|
6447 } else if (aKey == @symbol(COLOR_BTNTEXT)) { |
|
6448 p = COLOR_BTNTEXT; |
|
6449 } else if (aKey == @symbol(COLOR_GRAYTEXT)) { |
|
6450 p = COLOR_GRAYTEXT; |
|
6451 } else if (aKey == @symbol(COLOR_HIGHLIGHT)) { |
|
6452 p = COLOR_HIGHLIGHT; |
|
6453 } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) { |
|
6454 p = COLOR_HIGHLIGHTTEXT; |
|
6455 } else if (aKey == @symbol(COLOR_MENU)) { |
|
6456 p = COLOR_MENU; |
|
6457 } else if (aKey == @symbol(COLOR_MENUTEXT)) { |
|
6458 p = COLOR_MENUTEXT; |
|
6459 } else if (aKey == @symbol(COLOR_SCROLLBAR)) { |
|
6460 p = COLOR_SCROLLBAR; |
|
6461 #ifdef COLOR_SHADOW |
|
6462 } else if (aKey == @symbol(COLOR_SHADOW)) { |
|
6463 p = COLOR_SHADOW; |
|
6464 #endif |
|
6465 #ifdef COLOR_BACKGROUND |
|
6466 } else if (aKey == @symbol(COLOR_BACKGROUND)) { |
|
6467 p = COLOR_BACKGROUND; |
|
6468 #endif |
|
6469 #ifdef COLOR_ACTIVECAPTION |
|
6470 } else if (aKey == @symbol(COLOR_ACTIVECAPTION)) { |
|
6471 p = COLOR_ACTIVECAPTION; |
|
6472 #endif |
|
6473 #ifdef COLOR_INACTIVECAPTION |
|
6474 } else if (aKey == @symbol(COLOR_INACTIVECAPTION)) { |
|
6475 p = COLOR_INACTIVECAPTION; |
|
6476 #endif |
|
6477 #ifdef COLOR_WINDOWFRAME |
|
6478 } else if (aKey == @symbol(COLOR_WINDOWFRAME)) { |
|
6479 p = COLOR_WINDOWFRAME; |
|
6480 #endif |
|
6481 #ifdef COLOR_CAPTIONTEXT |
|
6482 } else if (aKey == @symbol(COLOR_CAPTIONTEXT)) { |
|
6483 p = COLOR_CAPTIONTEXT; |
|
6484 #endif |
|
6485 #ifdef COLOR_ACTIVEBORDER |
|
6486 } else if (aKey == @symbol(COLOR_ACTIVEBORDER)) { |
|
6487 p = COLOR_ACTIVEBORDER; |
|
6488 #endif |
|
6489 #ifdef COLOR_INACTIVEBORDER |
|
6490 } else if (aKey == @symbol(COLOR_INACTIVEBORDER)) { |
|
6491 p = COLOR_INACTIVEBORDER; |
|
6492 #endif |
|
6493 #ifdef COLOR_APPWORKSPACE |
|
6494 } else if (aKey == @symbol(COLOR_APPWORKSPACE)) { |
|
6495 p = COLOR_APPWORKSPACE; |
|
6496 #endif |
|
6497 #ifdef COLOR_INACTIVECAPTIONTEXT |
|
6498 } else if (aKey == @symbol(COLOR_INACTIVECAPTIONTEXT)) { |
|
6499 p = COLOR_INACTIVECAPTIONTEXT; |
|
6500 #endif |
|
6501 #ifdef COLOR_BTNHIGHLIGHT |
|
6502 } else if (aKey == @symbol(COLOR_BTNHIGHLIGHT)) { |
|
6503 p = COLOR_BTNHIGHLIGHT; |
|
6504 #endif |
|
6505 #ifdef COLOR_3DDKSHADOW |
|
6506 } else if (aKey == @symbol(COLOR_3DDKSHADOW)) { |
|
6507 p = COLOR_3DDKSHADOW; |
|
6508 #endif |
|
6509 #ifdef COLOR_3DLIGHT |
|
6510 } else if (aKey == @symbol(COLOR_3DLIGHT)) { |
|
6511 p = COLOR_3DLIGHT; |
|
6512 #endif |
|
6513 #ifdef COLOR_INFOTEXT |
|
6514 } else if (aKey == @symbol(COLOR_INFOTEXT)) { |
|
6515 p = COLOR_INFOTEXT; |
|
6516 #endif |
|
6517 #ifdef COLOR_INFOBK |
|
6518 } else if (aKey == @symbol(COLOR_INFOBK)) { |
|
6519 p = COLOR_INFOBK; |
|
6520 #endif |
|
6521 #ifdef COLOR_HOTLIGHT |
|
6522 } else if (aKey == @symbol(COLOR_HOTLIGHT)) { |
|
6523 p = COLOR_HOTLIGHT; |
|
6524 #endif |
|
6525 #ifdef COLOR_GRADIENTACTIVECAPTION |
|
6526 } else if (aKey == @symbol(COLOR_GRADIENTACTIVECAPTION)) { |
|
6527 p = COLOR_GRADIENTACTIVECAPTION; |
|
6528 #endif |
|
6529 #ifdef COLOR_GRADIENTINACTIVECAPTION |
|
6530 } else if (aKey == @symbol(COLOR_GRADIENTINACTIVECAPTION)) { |
|
6531 p = COLOR_GRADIENTINACTIVECAPTION; |
|
6532 #endif |
|
6533 #ifdef COLOR_DESKTOP |
|
6534 } else if (aKey == @symbol(COLOR_DESKTOP)) { |
|
6535 p = COLOR_DESKTOP; |
|
6536 #endif |
|
6537 #ifdef COLOR_3DFACE |
|
6538 } else if (aKey == @symbol(COLOR_3DFACE)) { |
|
6539 p = COLOR_3DFACE; |
|
6540 #endif |
|
6541 #ifdef COLOR_3DSHADOW |
|
6542 } else if (aKey == @symbol(COLOR_3DSHADOW)) { |
|
6543 p = COLOR_3DSHADOW; |
|
6544 #endif |
|
6545 #ifdef COLOR_3DHIGHLIGHT |
|
6546 } else if (aKey == @symbol(COLOR_3DHIGHLIGHT)) { |
|
6547 p = COLOR_3DHIGHLIGHT; |
|
6548 #endif |
|
6549 #ifdef COLOR_3DHILIGHT |
|
6550 } else if (aKey == @symbol(COLOR_3DHILIGHT)) { |
|
6551 p = COLOR_3DHILIGHT; |
|
6552 #endif |
|
6553 #ifdef COLOR_BTNHILIGHT |
|
6554 } else if (aKey == @symbol(COLOR_BTNHILIGHT)) { |
|
6555 p = COLOR_BTNHILIGHT; |
|
6556 #endif |
|
6557 } else { |
|
6558 goto getOutOfHere; |
|
6559 } |
|
6560 __rgb = GetSysColor(p); |
|
6561 /* win uses BGR order */ |
|
6562 r = __rgb & 0xFF; |
|
6563 g = (__rgb >> 8) & 0xFF; |
|
6564 b = (__rgb >> 16) & 0xFF; |
|
6565 __rgb = (((r << 8) | g) << 8) | b; |
|
6566 rgb = __MKSMALLINT(__rgb); |
|
6567 getOutOfHere: ; |
|
6568 %}. |
|
6569 rgb isNil ifTrue:[ ^ nil ]. |
|
6570 |
|
6571 ^ Color |
|
6572 redByte:((rgb bitShift:-16) bitAnd:16rFF) |
|
6573 greenByte:((rgb bitShift:-8) bitAnd:16rFF) |
|
6574 blueByte:(rgb bitAnd:16rFF) |
6439 |
6575 |
6440 " |
6576 " |
6441 Display getSystemColor:#COLOR_WINDOW |
6577 Display getSystemColor:#COLOR_WINDOW |
6442 Display getSystemColor:#COLOR_HIGHLIGHT |
6578 Display getSystemColor:#COLOR_HIGHLIGHT |
6443 " |
6579 " |
|
6580 |
|
6581 "Modified: / 30-10-2007 / 15:06:02 / cg" |
6444 ! |
6582 ! |
6445 |
6583 |
6446 getSystemMetrics:aNumberOrSymbol |
6584 getSystemMetrics:aNumberOrSymbol |
6447 "get a system metrics value; |
6585 "get a system metrics value; |
6448 the argument is a #define-like symbol as described in the windows API; |
6586 the argument is a #define-like symbol as described in the windows API; |
6797 WinWorkstation ignoreButtonPressOnActivate:true |
6935 WinWorkstation ignoreButtonPressOnActivate:true |
6798 WinWorkstation ignoreButtonPressOnActivate:false |
6936 WinWorkstation ignoreButtonPressOnActivate:false |
6799 " |
6937 " |
6800 ! |
6938 ! |
6801 |
6939 |
6802 primGetSystemColor:aKey |
|
6803 %{ /* NOCONTEXT */ |
|
6804 int p; |
|
6805 int rgb, r, g, b; |
|
6806 |
|
6807 if (aKey == @symbol(COLOR_WINDOW)) { |
|
6808 p = COLOR_WINDOW; |
|
6809 } else if (aKey == @symbol(COLOR_WINDOWTEXT)) { |
|
6810 p = COLOR_WINDOWTEXT; |
|
6811 } else if (aKey == @symbol(COLOR_MENU)) { |
|
6812 p = COLOR_MENU; |
|
6813 } else if (aKey == @symbol(COLOR_MENUTEXT)) { |
|
6814 p = COLOR_MENUTEXT; |
|
6815 } else if (aKey == @symbol(COLOR_BTNFACE)) { |
|
6816 p = COLOR_BTNFACE; |
|
6817 } else if (aKey == @symbol(COLOR_BTNSHADOW)) { |
|
6818 p = COLOR_BTNSHADOW; |
|
6819 } else if (aKey == @symbol(COLOR_BTNTEXT)) { |
|
6820 p = COLOR_BTNTEXT; |
|
6821 } else if (aKey == @symbol(COLOR_GRAYTEXT)) { |
|
6822 p = COLOR_GRAYTEXT; |
|
6823 } else if (aKey == @symbol(COLOR_HIGHLIGHT)) { |
|
6824 p = COLOR_HIGHLIGHT; |
|
6825 } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) { |
|
6826 p = COLOR_HIGHLIGHTTEXT; |
|
6827 } else if (aKey == @symbol(COLOR_MENU)) { |
|
6828 p = COLOR_MENU; |
|
6829 } else if (aKey == @symbol(COLOR_MENUTEXT)) { |
|
6830 p = COLOR_MENUTEXT; |
|
6831 } else if (aKey == @symbol(COLOR_SCROLLBAR)) { |
|
6832 p = COLOR_SCROLLBAR; |
|
6833 #ifdef COLOR_SHADOW |
|
6834 } else if (aKey == @symbol(COLOR_SHADOW)) { |
|
6835 p = COLOR_SHADOW; |
|
6836 #endif |
|
6837 #ifdef COLOR_BACKGROUND |
|
6838 } else if (aKey == @symbol(COLOR_BACKGROUND)) { |
|
6839 p = COLOR_BACKGROUND; |
|
6840 #endif |
|
6841 #ifdef COLOR_ACTIVECAPTION |
|
6842 } else if (aKey == @symbol(COLOR_ACTIVECAPTION)) { |
|
6843 p = COLOR_ACTIVECAPTION; |
|
6844 #endif |
|
6845 #ifdef COLOR_INACTIVECAPTION |
|
6846 } else if (aKey == @symbol(COLOR_INACTIVECAPTION)) { |
|
6847 p = COLOR_INACTIVECAPTION; |
|
6848 #endif |
|
6849 #ifdef COLOR_WINDOWFRAME |
|
6850 } else if (aKey == @symbol(COLOR_WINDOWFRAME)) { |
|
6851 p = COLOR_WINDOWFRAME; |
|
6852 #endif |
|
6853 #ifdef COLOR_CAPTIONTEXT |
|
6854 } else if (aKey == @symbol(COLOR_CAPTIONTEXT)) { |
|
6855 p = COLOR_CAPTIONTEXT; |
|
6856 #endif |
|
6857 #ifdef COLOR_ACTIVEBORDER |
|
6858 } else if (aKey == @symbol(COLOR_ACTIVEBORDER)) { |
|
6859 p = COLOR_ACTIVEBORDER; |
|
6860 #endif |
|
6861 #ifdef COLOR_INACTIVEBORDER |
|
6862 } else if (aKey == @symbol(COLOR_INACTIVEBORDER)) { |
|
6863 p = COLOR_INACTIVEBORDER; |
|
6864 #endif |
|
6865 #ifdef COLOR_APPWORKSPACE |
|
6866 } else if (aKey == @symbol(COLOR_APPWORKSPACE)) { |
|
6867 p = COLOR_APPWORKSPACE; |
|
6868 #endif |
|
6869 #ifdef COLOR_INACTIVECAPTIONTEXT |
|
6870 } else if (aKey == @symbol(COLOR_INACTIVECAPTIONTEXT)) { |
|
6871 p = COLOR_INACTIVECAPTIONTEXT; |
|
6872 #endif |
|
6873 #ifdef COLOR_BTNHIGHLIGHT |
|
6874 } else if (aKey == @symbol(COLOR_BTNHIGHLIGHT)) { |
|
6875 p = COLOR_BTNHIGHLIGHT; |
|
6876 #endif |
|
6877 #ifdef COLOR_3DDKSHADOW |
|
6878 } else if (aKey == @symbol(COLOR_3DDKSHADOW)) { |
|
6879 p = COLOR_3DDKSHADOW; |
|
6880 #endif |
|
6881 #ifdef COLOR_3DLIGHT |
|
6882 } else if (aKey == @symbol(COLOR_3DLIGHT)) { |
|
6883 p = COLOR_3DLIGHT; |
|
6884 #endif |
|
6885 #ifdef COLOR_INFOTEXT |
|
6886 } else if (aKey == @symbol(COLOR_INFOTEXT)) { |
|
6887 p = COLOR_INFOTEXT; |
|
6888 #endif |
|
6889 #ifdef COLOR_INFOBK |
|
6890 } else if (aKey == @symbol(COLOR_INFOBK)) { |
|
6891 p = COLOR_INFOBK; |
|
6892 #endif |
|
6893 #ifdef COLOR_HOTLIGHT |
|
6894 } else if (aKey == @symbol(COLOR_HOTLIGHT)) { |
|
6895 p = COLOR_HOTLIGHT; |
|
6896 #endif |
|
6897 #ifdef COLOR_GRADIENTACTIVECAPTION |
|
6898 } else if (aKey == @symbol(COLOR_GRADIENTACTIVECAPTION)) { |
|
6899 p = COLOR_GRADIENTACTIVECAPTION; |
|
6900 #endif |
|
6901 #ifdef COLOR_GRADIENTINACTIVECAPTION |
|
6902 } else if (aKey == @symbol(COLOR_GRADIENTINACTIVECAPTION)) { |
|
6903 p = COLOR_GRADIENTINACTIVECAPTION; |
|
6904 #endif |
|
6905 #ifdef COLOR_DESKTOP |
|
6906 } else if (aKey == @symbol(COLOR_DESKTOP)) { |
|
6907 p = COLOR_DESKTOP; |
|
6908 #endif |
|
6909 #ifdef COLOR_3DFACE |
|
6910 } else if (aKey == @symbol(COLOR_3DFACE)) { |
|
6911 p = COLOR_3DFACE; |
|
6912 #endif |
|
6913 #ifdef COLOR_3DSHADOW |
|
6914 } else if (aKey == @symbol(COLOR_3DSHADOW)) { |
|
6915 p = COLOR_3DSHADOW; |
|
6916 #endif |
|
6917 #ifdef COLOR_3DHIGHLIGHT |
|
6918 } else if (aKey == @symbol(COLOR_3DHIGHLIGHT)) { |
|
6919 p = COLOR_3DHIGHLIGHT; |
|
6920 #endif |
|
6921 #ifdef COLOR_3DHILIGHT |
|
6922 } else if (aKey == @symbol(COLOR_3DHILIGHT)) { |
|
6923 p = COLOR_3DHILIGHT; |
|
6924 #endif |
|
6925 #ifdef COLOR_BTNHILIGHT |
|
6926 } else if (aKey == @symbol(COLOR_BTNHILIGHT)) { |
|
6927 p = COLOR_BTNHILIGHT; |
|
6928 #endif |
|
6929 } else { |
|
6930 RETURN (nil); |
|
6931 } |
|
6932 rgb = GetSysColor(p); |
|
6933 /* win uses BGR order */ |
|
6934 r = rgb & 0xFF; |
|
6935 g = (rgb >> 8) & 0xFF; |
|
6936 b = (rgb >> 16) & 0xFF; |
|
6937 rgb = (((r << 8) | g) << 8) | b; |
|
6938 RETURN (__MKSMALLINT(rgb)); |
|
6939 %}. |
|
6940 |
|
6941 " |
|
6942 Screen current getSystemColor:#COLOR_HOTLIGHT |
|
6943 Screen current getSystemColor:#COLOR_HIGHLIGHT |
|
6944 " |
|
6945 ! |
|
6946 |
|
6947 primViewIdFromPoint:aPoint in:windowId |
6940 primViewIdFromPoint:aPoint in:windowId |
6948 "given a point in rootWindow, return the viewId of the subview of windowId |
6941 "given a point in rootWindow, return the viewId of the subview of windowId |
6949 hit by this coordinate. Return nil if no view was hit. |
6942 hit by this coordinate. Return nil if no view was hit. |
6950 The returned id may be the id of a non ST view. |
6943 The returned id may be the id of a non ST view. |
6951 - used to find the window to drop objects after a cross-view drag." |
6944 - used to find the window to drop objects after a cross-view drag." |
7439 } |
7432 } |
7440 DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle)); |
7433 DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle)); |
7441 } |
7434 } |
7442 RETURN (nil); |
7435 RETURN (nil); |
7443 %} |
7436 %} |
|
7437 ! |
|
7438 |
|
7439 createTrayWindowFor:aView |
|
7440 icon:wicon iconMask:wiconMaskArg |
|
7441 toolTipMessage:toolTipMessageArg |
|
7442 |
|
7443 |windowId wiconId wiconMask invertedWiconMask wiconMaskId |
|
7444 wiconWidth wiconHeight toolTipMessage| |
|
7445 |
|
7446 "/ the toolTop string cannot be longer than 64 characters including the NULL terminator |
|
7447 toolTipMessageArg size > 63 ifTrue:[ |
|
7448 toolTipMessage := toolTipMessageArg copyTo:63 |
|
7449 ] ifFalse:[ |
|
7450 toolTipMessage := toolTipMessageArg. |
|
7451 ]. |
|
7452 |
|
7453 windowId := aView id. |
|
7454 |
|
7455 wicon notNil ifTrue:[ |
|
7456 wiconId := wicon id. |
|
7457 wiconHeight := wicon height. |
|
7458 wiconWidth := wicon width. |
|
7459 wiconMask := wiconMaskArg. |
|
7460 wiconMask isNil ifTrue:[ |
|
7461 wiconMask := wicon mask. |
|
7462 ]. |
|
7463 wiconMask notNil ifTrue:[ |
|
7464 "/ WIN32's mask has zeros for opaque pixels |
|
7465 invertedWiconMask := wiconMask copy. |
|
7466 invertedWiconMask bits invert. |
|
7467 invertedWiconMask := invertedWiconMask onDevice:self. |
|
7468 wiconMaskId := invertedWiconMask id |
|
7469 ]. |
|
7470 ]. |
|
7471 |
|
7472 %{ /* STACK: 16000 */ |
|
7473 #ifndef WM_TRAY_MESSAGE |
|
7474 # define WM_TRAY_MESSAGE (WM_USER+0x0200) |
|
7475 #endif |
|
7476 HBITMAP xBitMap, maskBitmap; |
|
7477 HICON xIcon = (HICON)0; |
|
7478 ICONINFO iconInfo; |
|
7479 NOTIFYICONDATA nid; |
|
7480 unsigned char fastBits[10000]; |
|
7481 |
|
7482 /* get bitmap for icon */ |
|
7483 if ( __isExternalAddress(wiconId) ) { |
|
7484 xBitMap = _HBITMAPVAL( wiconId ); |
|
7485 if ( xBitMap != 0 ) { |
|
7486 BITMAP bm; |
|
7487 |
|
7488 if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) { |
|
7489 int d = bm.bmPlanes * bm.bmBitsPixel; |
|
7490 BYTE *ep; |
|
7491 int height, width; |
|
7492 int nBytes; |
|
7493 unsigned char *allocatedBits = 0; |
|
7494 int privateMask = 0; |
|
7495 |
|
7496 if ( __isExternalAddress(wiconMaskId) ) { |
|
7497 maskBitmap = _HBITMAPVAL( wiconMaskId ); |
|
7498 } else { |
|
7499 if (wiconMaskId != nil) { |
|
7500 PRINTF(("WinWorkstat [warning]: wiconMaskId is not an external address\n")); |
|
7501 } |
|
7502 maskBitmap = 0; |
|
7503 } |
|
7504 |
|
7505 /* |
|
7506 * if there is no mask, generate one |
|
7507 */ |
|
7508 if (maskBitmap == 0) { |
|
7509 DPRINTF(("Bitmap w:%d h:%d p:%d d:%d\n",bm.bmWidth,bm.bmHeight,bm.bmPlanes,bm.bmBitsPixel)); |
|
7510 height = __intVal( wiconHeight ); |
|
7511 width = __intVal( wiconWidth ); |
|
7512 nBytes = ( width + 15 ) / 8; |
|
7513 nBytes = height * nBytes; |
|
7514 if (nBytes < sizeof(fastBits)) { |
|
7515 ep = fastBits; |
|
7516 } else { |
|
7517 ep = allocatedBits = (unsigned char *) malloc(nBytes); |
|
7518 } |
|
7519 if ( ep == 0 ) { |
|
7520 PRINTF(( "WinWorkstat [warning]: malloc failed\n" )); |
|
7521 } else { |
|
7522 memset(ep, 0, nBytes); |
|
7523 maskBitmap = CreateBitmap(width, height, 1, 1, ep ); |
|
7524 if ( maskBitmap == NULL ) { |
|
7525 PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" )); |
|
7526 } else { |
|
7527 privateMask = 1; |
|
7528 } |
|
7529 } |
|
7530 } |
|
7531 if ( maskBitmap != NULL ) { |
|
7532 DPRINTF(( "BITMAP mask CREATED!!!\n" )); |
|
7533 iconInfo.fIcon = TRUE; |
|
7534 iconInfo.hbmMask = maskBitmap; |
|
7535 iconInfo.hbmColor = xBitMap; |
|
7536 xIcon = CreateIconIndirect( &iconInfo ); |
|
7537 if (privateMask) { |
|
7538 DeleteObject( maskBitmap ); |
|
7539 } |
|
7540 } else { |
|
7541 PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" )); |
|
7542 } |
|
7543 |
|
7544 if (allocatedBits) { |
|
7545 free(allocatedBits); |
|
7546 } |
|
7547 } |
|
7548 } else { |
|
7549 DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" )); |
|
7550 } |
|
7551 } else { |
|
7552 if (wiconId != nil) { |
|
7553 PRINTF(("WinWorkstat [warning]: wiconId is not an external address\n")); |
|
7554 } |
|
7555 } |
|
7556 |
|
7557 ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); |
|
7558 nid.cbSize = sizeof(NOTIFYICONDATA); |
|
7559 |
|
7560 if (__isExternalAddress(windowId)) { |
|
7561 HWND hwnd = _HWNDVal(windowId); |
|
7562 |
|
7563 |
|
7564 if (hwnd && IsWindow(hwnd)) { |
|
7565 nid.hWnd = hwnd; //the hWnd and uID members allow the OS to uniquely identify your icon. |
|
7566 // One window (the hWnd) can have more than one icon, as long as they have unique uIDs. |
|
7567 nid.uFlags = |
|
7568 NIF_ICON //we're adding an icon |
|
7569 | NIF_MESSAGE //we want the tray to send a message to the window identified by hWnd when something happens to our icon (see uCallbackMesage member below). |
|
7570 | NIF_TIP; //our icon has a tooltip. |
|
7571 |
|
7572 nid.uCallbackMessage = WM_TRAY_MESSAGE; //this message must be handled in hwnd's window procedure. more info below. |
|
7573 if (xIcon) { |
|
7574 nid.hIcon = xIcon; |
|
7575 /* wc.hIconSm = wiconId; In 4.x there are large and small icons */ |
|
7576 } else { |
|
7577 nid.hIcon = NULL; /* THIS MUST BE NULL TO DELETE ICONS */ |
|
7578 } |
|
7579 if (__isString(toolTipMessage)) { |
|
7580 strcpy(nid.szTip, __stringVal(toolTipMessage)); |
|
7581 } |
|
7582 Shell_NotifyIcon(NIM_ADD, &nid); |
|
7583 } |
|
7584 } |
|
7585 %} |
|
7586 |
|
7587 "Created: / 30-10-2007 / 16:28:30 / cg" |
7444 ! |
7588 ! |
7445 |
7589 |
7446 createWindowFor:aView type:typeSymbol |
7590 createWindowFor:aView type:typeSymbol |
7447 origin:origin |
7591 origin:origin |
7448 extent:extent |
7592 extent:extent |