| |
|
|
Georg Hovenbitzer | Hello together,
at nachfolgenden code have I the trouble, that to the Translation in the Variable &wParam not the correctly. worth include is. it ought to the same deserve How Button&, is by me always 2. All other values voices ! CompileMarkSeparationDef HiWord(1) (@&(1) $10000)
Declare Button&
WindowStyle 512 + 16 + 8 + 2
WindowTitle "Test"
Window 100,100-400,300
UserMessages $0021,$0111,$0010
~WM_MOUSEACTIVATE,~WM_COMMAND,~WM_CLOSE
Button& = @Create("Button",%hWnd,"rechts Klick?",100,100,200,100)
WhileNot %UMessage = $0010
WaitInput
If %UMessage =$0021 ~WM_MOUSEACTIVATE
Print &wParam
Print Button&
Print HiWord(&ULParam)
If (&wParam = Button&) And (HiWord(&ULParam) = $0204) ~WM_RBUTTONDOWN
Print "Treffer"
EndIf
EndIf
EndWhile
End
|
|
|
| Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a) | 11/12/05 ▲ |
|
|
|
|
Sebastian König | Hello Georg,
unfortunately shining the a the situations To his, in them the unvermeidlichen small differences in the Message-Handling noticeable make
If I the (with Spy++) correctly. determined have, stammt the worth, the in &WParam standing, not of WM_MOUSEACTIVATE , separate a vorangegangenen WM_SETCURSOR -Message. its means more or less chance, that the so fit and can itself well not safety reproduzieren...
If it only therefore goes, whom Rechtklick on the Button abzufragen, should it rather functions, WM_PARENTNOTIFY as UserMessage To take.
MfG
Sebastian |
|
|
| Windows XP, XProfan/Profan² 4.5 bis 11 Profan2Cpp-Homepage: [...] Alte Profan²-Seite: [...] | 11/13/05 ▲ |
|
|
|
|
Georg Hovenbitzer | Hello Sebastian,
thanks for hint with WM_PARENTNOTIFY. only How I get now on The address of Button& without &wParam abzufragen ? have you got as a hint for me ? CompileMarkSeparationDef HiWord(1) (@&(1) $10000)
Def LoWord(1) @&(1) & $FFFF
Declare Button&
WindowStyle 512 + 16 + 8 + 2
WindowTitle "Test"
Window 100,100-400,300
UserMessages $0111,$0010,$0210
~WM_MOUSEACTIVATE $0021
~WM_COMMAND $0111
~WM_CLOSE $0010
Wm_parentnotify $0210
Button& = @Create("Button",%hWnd,"rechts Klick?",100,100,200,100)
WhileNot %UMessage = $0010
WaitInput
If %UMessage =$0210 Wm_parentnotify
Print LoWord(&UwParam)," = ","516" ~WM_RBUTTONDOWN
Print "?"," = ",Button&
If (&wParam = Button&) And (LoWord(&UwParam) = 516) ~WM_RBUTTONDOWN
Print "Treffer"
EndIf
EndIf
EndWhile
End
|
|
|
| Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a) | 11/13/05 ▲ |
|
|
|
|
Georg Hovenbitzer | Hello Sebastian,
I have one Solution found The in the Übersetzten Version very well functions.
I read with GetCursorPos() The Mausposition from and WindowFromPoint() which Control itself under befindet. CompileMarkSeparationDef GetCursorPos(1) !"USER32","GetCursorPos"
Def WindowFromPoint(2) !"USER32","WindowFromPoint"
Def Hiword(1) (@&(1) $10000)
Declare FSpeicher&
Declare TFSpeicher&
Declare MausPos#
Dim MausPos#,8
WindowStyle 512 + 16 + 8 + 2
Windowtitle "Test"
Window 0,0-800,600
Usermessages $0021,$0111,$0010
~WM_MOUSEACTIVATE,~WM_COMMAND,~WM_CLOSE
FSpeicher& = @Control("COMBOBOX","",$54310003,330,32,100,90,%hWnd,90,%hInstance)
TFSpeicher& = @Create("Tooltip",%hWnd,FSpeicher&,"siehe rechte Maustaste")
WhileNot %Umessage = $0010
WaitInput
If (%Umessage =$0021) And (Hiword(&Ulparam) = $0204)~WM_MOUSEACTIVATE
Clear MausPos#
GetCursorPos(MausPos#)
If (WindowFromPoint(@Long(MausPos#,0),@Long(MausPos#,4)) = FSpeicher&)~WM_RBUTTONDOWN
Print "Treffer"
EndIf
EndIf
EndWhile
Dispose MausPos#
End
|
|
|
| Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a) | 11/14/05 ▲ |
|
|
|
|
Sebastian König | Hello Georg,
were something faster as i to Vollständigkeit here another alternativer (but integrally similar) suggestion:
with WM_PARENTNOTIFY becomes (anyway with Mausereignissen) too The actually Mausposition in &ULParam (HiWord/LoWord) transfer. here would it means too so functions: CompileMarkSeparation deference: ChildWindowFromPoint(), since the Coordinates relatively are.
MfG
Sebastian
P.s.: In Your code is the appeal Windowfrompoint(@Long(Mauspos#,0),@Long(Mauspos#,4)) not integrally correctly.... it ought to simply WindowFromPoint(Mouspos#) his |
|
|
| Windows XP, XProfan/Profan² 4.5 bis 11 Profan2Cpp-Homepage: [...] Alte Profan²-Seite: [...] | 11/14/05 ▲ |
|
|
|
|
Georg Hovenbitzer | Hello Sebastian,
many Thanks for hint. with WindowFromPoint must I you wiedersprechen. loudly Win32.hlp and MSDN have you got of course right, but it lead by me always To wicked crash. If one here in the API data base schaut and Internet, finds one always my Solution with two Parameters. |
|
|
| Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a) | 11/14/05 ▲ |
|
|
|
|
Sebastian König | Hello Georg,
Yes, sorry - you have naturally right! I had The Doku well To volatile red and not realisert, that The function objectively a POINT (zusammengesetzt from 2 Longs) and even not The address of/ one POINT-structure expects. the same counts for ChildWindowFromPoint...
Nochmal sorry for Verwirrung!
MfG
Sebastian |
|
|
| Windows XP, XProfan/Profan² 4.5 bis 11 Profan2Cpp-Homepage: [...] Alte Profan²-Seite: [...] | 11/14/05 ▲ |
|
|
|
|
|
PS: I find the Smilie so G**L. |
|
|
| |
|
|