Win32lib addition....
- Posted by "H.W Overman" <euman at bellsouth.net> Nov 23, 2003
- 434 views
Hello Derek and Win32lib coders I needed this tid-bit of code for a recent little app Im writing I have the code below for the UPDOWN controls UDM_SETACCEL constant DRCGroup = createEx( Group, "", MainWin, 288, 56, 108, 96, 0, 0 ), c140 = createEx( EditText, "", DRCGroup, 20, 63, 86, 22, or_all({ES_CENTER, WS_EX_CLIENTEDGE}), 0 ), c150 = create( UpDown, "UpDown69", DRCGroup, 80, 56, 0, 20, or_all({UDS_AUTOBUDDY, UDS_WRAP, UDS_ALIGNRIGHT,UDS_SETBUDDYINT,UDS_ARROWKEYS})) setBuddy( c150, c140 ) setScrollRange( c150, 1000, 5000 ) atom MyAccel MyAccel = allocate(8) constant MyAccel_nSec = MyAccel + 0, MyAccel_nInc = MyAccel + 4 poke4(MyAccel_nSec, 0) poke4(MyAccel_nInc, 1000) VOID = sendMessage( c150, UDM_SETACCEL, 1, MyAccel ) setText( c140, "1000" ) With this you can count by a set number, in this case by 1000. Here is the recommended procedure addition: procedure SetUPDOWNAccel( atom hWnd, integer Time, integer Tickrate ) atom MyAccel, id MyAccel = allocate(8) poke4(MyAccel, Time) poke4(MyAccel + 4, Tickrate) id = getHandle(hWnd) -- maybe this isnt needed for the current version of win32lib VOID = sendMessage( id, UDM_SETACCEL, 1, MyAccel ) end procedure maybe usefull to someone. Euman