flat assembler
Message board for the users of flat assembler.
Index
> Windows > Showing a tooltip when mouse hovers over control |
Author |
|
bzdashek 20 Apr 2012, 20:30
Good day, everyone!
Does anyone have a piece of working asm code as an example of attaching a tooltip to control? I'm attaching my code in return. It's just an experiment and it isn't finished yet, just basic functions, and probably it doesn't work on anything other then Intel, so be careful. To populate the CPU Brand string, I used a piece of typedef's code. Thanks, typedef. FPU test code is taken from Intel's CPUID manual. The idea is to make an explanation to each and every CPU feature flag, so user won't need to use the Internets to search for reference. Another useless program, here it goes:
Last edited by bzdashek on 21 Apr 2012, 10:36; edited 1 time in total |
||||||||||||||||||||
20 Apr 2012, 20:30 |
|
bzdashek 21 Apr 2012, 09:25
AsmGuru62
Thank you for the compliment about the program Well, I managed to create a test tooltip myself, so there's no need for example already, thanks a lot for an idea. I used this code: http://msdn.microsoft.com/en-us/library/windows/desktop/hh298368(v=vs.85).aspx Will try it first, if it won't do, will try to make a multiline from here: http://msdn.microsoft.com/en-us/library/windows/desktop/hh298403(v=vs.85).aspx When it will be finished, I'll upload the new version |
|||
21 Apr 2012, 09:25 |
|
bzdashek 21 Apr 2012, 10:37
Uploaded a new version with tooltips.
|
|||
21 Apr 2012, 10:37 |
|
typedef 21 Apr 2012, 10:45
Start >Run > type 'WMIC'
type /? |
|||
21 Apr 2012, 10:45 |
|
bzdashek 21 Apr 2012, 14:23
typedef wrote: Start >Run > type 'WMIC' Thanks You're telling me, that I'm wasting my time? |
|||
21 Apr 2012, 14:23 |
|
bzdashek 21 Apr 2012, 17:43
I'm sure it was discussed here, and I just can't find the appropriate thread.
When a child window (i.e. BUTTON) has focus, how can I catch the WM_KEYDOWN message in a Dialog Application? For example, I need to show the About box on VK_F1 keypress. I tried to use WM_NOTIFY, trapping NM_KEYDOWN message, but it never gets invoked. Please advice |
|||
21 Apr 2012, 17:43 |
|
JohnFound 21 Apr 2012, 18:51
You must process hot keys (these that should work independent on the focus) in the main message loop of the application.
Read about accelerators: CreateAcceleratorTable, TranslateAccelerator, etc. |
|||
21 Apr 2012, 18:51 |
|
bzdashek 21 Apr 2012, 19:23
JohnFound wrote: You must process hot keys (these that should work independent on the focus) in the main message loop of the application. Ok. I just wanted to avoid including the whole accelerators table for the sake of one key. I found an interesting article: http://msdn.microsoft.com/en-us/library/ms644995 maybe I'll manage to do that without accelerators. Thanks for the hint. UPD: I managed to do that without accelerators: 1. Used CreateDialogParam instead of DialogBoxParam, hence converting Modal dialog box to modeless. With that it is possible to interfere the message loop. 2. In the msg_loop the message is being checked, and if the message is WM_KEYDOWN and wparam is VK_F1, it is sent to main window. Code: ; invoke DialogBoxParam,eax,IDD_CPU,HWND_DESKTOP,DialogProc,0 invoke CreateDialogParam,eax,IDD_CPU,HWND_DESKTOP,DialogProc,0 mov [hWnd],eax .msg_loop: invoke GetMessage,msg,NULL,0,0 or eax,eax je .finish cmp [msg.message],WM_KEYDOWN jne @f cmp [msg.wParam],VK_F1 jne @f invoke SendMessage,[hWnd],WM_KEYDOWN,[msg.wParam],[msg.lParam] @@: invoke IsDialogMessage,[hWnd],msg jne .msg_loop invoke TranslateMessage,msg invoke DispatchMessage,msg jmp .msg_loop .not_supported: invoke MessageBox,HWND_DESKTOP,_no_cpuid,_title,MB_ICONHAND .finish: invoke ExitProcess,0 |
|||
21 Apr 2012, 19:23 |
|
Picnic 22 Apr 2012, 07:50
bzdashek wrote: Does anyone have a piece of working asm code as an example of attaching a tooltip to control? I have a masm sample showing various tooltip styles.
|
|||||||||||
22 Apr 2012, 07:50 |
|
bzdashek 22 Apr 2012, 08:48
Picnic wrote:
Thanks a lot, Picnic! |
|||
22 Apr 2012, 08:48 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.