| |
|
|
Ernst | first time the TestCode CompileMarkSeparation {$Iq}
Set("ErrorLevel",2)
Set("FastMode",1)
Declare WndClass#
Declare hwndClass$
Declare hwndName$
Struct myWindowClass = ~WNDCLASS
Dim WndClass#,myWindowClass
Declare msg#
struct tmsg = ~msg
Dim msg#,tmsg
hwndClass$ = "mywindow"
hwndName$ = "Test_Fenster"
'*****************************************************************************************
Proc WinMain
With WndClass#
.style& = ~CS_HREDRAW | ~CS_VREDRAW
.lpfnWndProc& = ProcAddr(Fensterproc,4)
.cbClsExtra& = 0
.cbWndExtra& = 0
.hInstance& = %hInstance
.hIcon& = ~LoadIcon(0,~IDI_Winlogo)
.hCursor& = ~LoadCursor(0, ~IDC_ARROW)
.hbrBackground& = ~createsolidbrush(RGB(150,150,150))
.lpszMenuName& = 0
.lpszClassName& = Addr(hwndClass$)
EndWith
~RegisterClass(WndClass#)
dispose wndclass#
var hwnd& = ~CreateWindowEx(0,Addr(hwndClass$),Addr(hwndName$),$02CA0000,100,100,1000,700,0,0,%hInstance,0)
~ShowWindow(hwnd&, ~SW_SHOWNORMAL)
While ~GetMessage(Msg#, 0, 0, 0) > 0
~TranslateMessage(Msg#)
~DispatchMessage(Msg#)
EndWhile
EndProc
'*****************************************************************************************
WinMain
dispose msg#
END
' ****************************************************************************************
nProc FensterProc
Parameters Wnd&, Message&, wParam&, lParam&
Var wDC&=~getDC(wnd&)
IF message& = ~WM_CLOSE
~PostQuitMessage(0)
ElseIf message& = ~wm_mousemove
LONG hv=dim(16)
setlong(hv&,0,16)
setlong(hv&,4,~TME_HOVER | ~TME_LEAVE)
setlong(hv&,8,wnd&)
setlong(hv&,12,~HOVER_DEFAULT)
~TrackMouseEvent(hv&)
dispose(hv&)
' test_1(wDC&,wnd&)
ElseIF message& = ~wm_mousehover
test_1(wDC&,wnd&)
ElseIF message& = ~wm_mouseleave
test_2(wDC&,wnd&)
EndIf
Return ~DefWindowProc(Wnd&, Message&, wParam&, lParam&)
EndProc
'*****************************************************************************************
nproc test_1
Parameters wDC&,Wnd&
LONG c_rect=Dim(16)
LONG text=dim(255)
~GetClientRect(Wnd&,c_rect)
~DeleteObject(~SelectObject(wDC& ~CreateSolidBrush(rgb(0,255,0))))
~DeleteObject(~SelectObject(wDC&, ~CreatePen(~PS_SOLID, 1,rgb(0,255,0))))
~RoundRect(wDC&, 400, 300, LONG(c_rect,8)-300,long(c_rect,12)-300, 20, 20)
~SetBkMode(wDC&, ~TRANSPARENT)
~SetTextColor(wDC&,rgb(255,255,0))
~GetWindowText(Wnd&, Text, ~globalsize(Text)-1)
~DrawTextEx(wDC&,Text,Len(STRING$(Text,0)),c_rect,~DT_SINGLELINE | ~DT_VCENTER | ~DT_CENTER,0)
dispose(c_rect)
dispose(text)
EndProc
' ----------------------------------------------------------------------------------------
nproc test_2
Parameters wDC&,Wnd&
LONG c_rect=Dim(16)
~GetClientRect(Wnd&,c_rect)
~DeleteObject(~SelectObject(wDC& ~CreateSolidBrush(rgb(255,255,0))))
~DeleteObject(~SelectObject(wDC&, ~CreatePen(~PS_SOLID, 1,rgb(255,255,0))))
~RoundRect(wDC&, 400, 300, LONG(c_rect,8)-300,long(c_rect,12)-300, 20, 20)
dispose(c_rect)
EndPr
'*****************************************************************************************
if I The mouse continuing inside the Fensters move (must not quick his) so there to ca. 15 To max. 30 sec following situations: a/ roundrect (green) freeze one (changes not to yellow , if The mouse outside the Fensters is) b/ roundrect (green) becomes left oberhalb in white again pictured. if I this Situtation (with both Opportunities) the window move wants there The wüstesten Bildschirmeffekte. its too alike whether I test_1 unter wm_mousemove or wm_mousehover aufrufe; somewhere clear, there Yes both messages with Mausbewegungen continuing gefeuert go, but the might still only one extremes Flackern the roundrect cause. Have I there something overlooking ?? |
|
|
| |
|
|
|
Nico Madysa | have whom View source straight only überflogen, but if You you a handle with GetDC give can, must You not afterwards too with ReleaseDC wieder enable?
[OFFTOPIC] Blöder Comment on Rande: If your XProfan-View source so looks, can you too same C or C++ write. [/OFFTOPIC] |
|
|
| |
|
|
|
Ernst | serious (17.05.14)
Have I there something overlooking ??
@Nico Uiuiuiui - and How I what overlooking have - thanks for your Aufklärungsflug (I had it sure yet for hours overlooking)
[OFFTOPIC] your blöder Comment on Rande isn't so stupid, but because of the nProcs use I still increase APIs [/OFFTOPIC] |
|
|
| |
|
|