Mercurial > dwindows
comparison win/dw.c @ 1397:2ccf7eacedf5
Safety checks in dw_bitmapbutton_new*() on Windows and OS/2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 27 Nov 2011 11:01:01 +0000 |
parents | 943266c86aed |
children | 8e569dd09d94 |
comparison
equal
deleted
inserted
replaced
1396:117cc38a3799 | 1397:2ccf7eacedf5 |
---|---|
3527 } | 3527 } |
3528 } | 3528 } |
3529 | 3529 |
3530 void _create_tooltip(HWND handle, char *text) | 3530 void _create_tooltip(HWND handle, char *text) |
3531 { | 3531 { |
3532 /* Create a tooltip. */ | 3532 if(text) |
3533 HWND hwndTT = CreateWindowEx(WS_EX_TOPMOST, | 3533 { |
3534 TOOLTIPS_CLASS, NULL, | 3534 /* Create a tooltip. */ |
3535 WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, | 3535 HWND hwndTT = CreateWindowEx(WS_EX_TOPMOST, |
3536 CW_USEDEFAULT, CW_USEDEFAULT, | 3536 TOOLTIPS_CLASS, NULL, |
3537 CW_USEDEFAULT, CW_USEDEFAULT, | 3537 WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, |
3538 handle, NULL, DWInstance,NULL); | 3538 CW_USEDEFAULT, CW_USEDEFAULT, |
3539 TOOLINFO ti = { 0 }; | 3539 CW_USEDEFAULT, CW_USEDEFAULT, |
3540 | 3540 handle, NULL, DWInstance,NULL); |
3541 SetWindowPos(hwndTT, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); | 3541 TOOLINFO ti = { 0 }; |
3542 | 3542 |
3543 /* Set up "tool" information. | 3543 SetWindowPos(hwndTT, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); |
3544 * In this case, the "tool" is the entire parent window. | 3544 |
3545 */ | 3545 /* Set up "tool" information. |
3546 ti.cbSize = sizeof(TOOLINFO); | 3546 * In this case, the "tool" is the entire parent window. |
3547 ti.uFlags = TTF_SUBCLASS; | 3547 */ |
3548 ti.hwnd = handle; | 3548 ti.cbSize = sizeof(TOOLINFO); |
3549 ti.hinst = DWInstance; | 3549 ti.uFlags = TTF_SUBCLASS; |
3550 ti.lpszText = text; | 3550 ti.hwnd = handle; |
3551 ti.rect.right = ti.rect.bottom = 500; | 3551 ti.hinst = DWInstance; |
3552 | 3552 ti.lpszText = text; |
3553 /* Associate the tooltip with the "tool" window. */ | 3553 ti.rect.right = ti.rect.bottom = 500; |
3554 SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); | 3554 |
3555 /* Associate the tooltip with the "tool" window. */ | |
3556 SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); | |
3557 } | |
3555 } | 3558 } |
3556 | 3559 |
3557 #ifndef GDIPLUS | 3560 #ifndef GDIPLUS |
3558 /* This function determines the handle for a supplied image filename | 3561 /* This function determines the handle for a supplied image filename |
3559 */ | 3562 */ |