SKControl.DLL | | | | - Seite 1 - |
| Stephan Sonneborn | Hallo zusammen,
ich hab in einem Programm farbige Edits mittels der SKControl.DLL erstellt. Da die hier erzeugten Handles keine "normalen" Handles sind, sondern "normale" Handles auf einem Elternhandle, hab ich Probleme mit der Aktivierungsreihenfolge.
Weiß jemand, wie man dann die Reihenfolge der Aktivierung beeinflussen oder mittels Enter (am liebsten) oder TAB von einem Edit-Feld ins nächste wechseln kann?
BringWindowToTop() hab ich zwar versucht, aber keinen Erfolg damit gehabt. KompilierenMarkierenSeparierenDEF GetWindow(2) !"USER32","GetWindow"
DEF SK_GETFOCUS(1) GetWindow(&(1),5)
VAR PrgDir$ = GETDIR$("@")
VAR LVDLL& = USEDLL(PrgDir$ + "\\SKControl.dll")
$I SKCONTROL.INC
SKCtrl_InitDll()
PROC CreateEditCL
PARAMETERS ParentHandle&, Text$, x%, y%, dx%, dy%, TColor&, BColor&
DECLARE Handle&
DECLARE SKString#
DIM SKString#, 255
STRING SKString#, 0 = Text$
Handle& = SKCtrl_CreateColorEdit(ParentHandle&,SKString#,Tcolor&,BColor&,x%,y%,dx%,dy%,%hInstance)
SETSTYLE SK_GETFOCUS(Handle&), 0, GETSTYLE(SK_GETFOCUS(Handle&)) + $0000
DISPOSE SKString#
RETURN Handle&
ENDPROC
CLS
VAR Edit1& = CreateEditCL(%HWND, "Hier 0 eingeben für ENDE", 10,10,200,20,0,RGB(255,0,0) )
VAR Edit2& = CreateEditCL(%HWND, "", 10,40,200,20,0,RGB(205,0,0) )
VAR Edit3& = CreateEditCL(%HWND, "", 10,80,200,20,0,RGB(155,0,0) )
VAR Edit4& = CreateEditCL(%HWND, "", 10,120,200,20,0,RGB(105,0,0) )
WHILE 1
WAITINPUT
CASE GETTEXT$(SK_GETFOCUS(Edit1&)) = "0": BREAK
WEND
SKCtrl_DeInitDll()
END
|
| | | Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 24.05.2011 ▲ |
| |
| | « Dieser Beitrag wurde als Lösung gekennzeichnet. » | | Andreas Miethe
| Versuch's mal so KompilierenMarkierenSeparieren $H Windows.ph
DEF GetWindow(2) !"USER32","GetWindow"
DEF SK_GETFOCUS(1) GetWindow(&(1),5)
VAR PrgDir$ = GETDIR$("@")
VAR LVDLL& = USEDLL(PrgDir$ + "\\SKControl.dll")
$I SKCONTROL.INC
SKCtrl_InitDll()
PROC CreateEditCL
PARAMETERS ParentHandle&, Text$, x%, y%, dx%, dy%, TColor&, BColor&
DECLARE Handle&
DECLARE SKString#
DIM SKString#, 255
STRING SKString#, 0 = Text$
Handle& = SKCtrl_CreateColorEdit(ParentHandle&,SKString#,Tcolor&,BColor&,x%,y%,dx%,dy%,%hInstance)
SETSTYLE SK_GETFOCUS(Handle&), 0, GETSTYLE(SK_GETFOCUS(Handle&)) + $0000
DISPOSE SKString#
RETURN Handle&
ENDPROC
CLS
VAR Edit1& = CreateEditCL(%HWND, "", 10,10,200,20,0,RGB(255,0,0) )
SetStyle Edit1&, GetStyle(Edit1&) | ~WS_GROUP
VAR Edit2& = CreateEditCL(%HWND, "", 10,40,200,20,0,RGB(205,0,0) )
VAR Edit3& = CreateEditCL(%HWND, "", 10,80,200,20,0,RGB(155,0,0) )
VAR Edit4& = CreateEditCL(%HWND, "", 10,120,200,20,0,RGB(105,0,0) )
VAR HEnde% = Create("BUTTON", %HWND, "Ende", 10,200,200,25)
VAR Ende% = 0
VAR i% = 0
AddHotKey 1000, $09, 0
AddHotKey 1001, $0D, 0
WHILENOT Ende%
WAITINPUT
If IsKey($09) Or IsKey($0D)
SetFocus(~GetNextDlgGroupItem(%hwnd,%Getfocus,0))
Endif
IF CLICKED(HEnde%)
Ende% = 1
ENDIF
WEND
SKCtrl_DeInitDll()
END
|
| | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 24.05.2011 ▲ |
| | |
| | | Bekommst Du WaitInput an der Stelle mit Enter durchbrochen? |
| | | | |
| | Stephan Sonneborn | Hallo iF,
iF (24.05.11)
Bekommst Du WaitInput an der Stelle mit Enter durchbrochen?
leider nein... KompilierenMarkierenSeparierenDEF GetWindow(2) !"USER32","GetWindow"
DEF SK_GETFOCUS(1) GetWindow(&(1),5)
VAR PrgDir$ = GETDIR$("@")
VAR LVDLL& = USEDLL(PrgDir$ + "\\SKControl.dll")
$I SKCONTROL.INC
SKCtrl_InitDll()
PROC CreateEditCL
PARAMETERS ParentHandle&, Text$, x%, y%, dx%, dy%, TColor&, BColor&
DECLARE Handle&
DECLARE SKString#
DIM SKString#, 255
STRING SKString#, 0 = Text$
Handle& = SKCtrl_CreateColorEdit(ParentHandle&,SKString#,Tcolor&,BColor&,x%,y%,dx%,dy%,%hInstance)
SETSTYLE SK_GETFOCUS(Handle&), 0, GETSTYLE(SK_GETFOCUS(Handle&)) + $0000
DISPOSE SKString#
RETURN Handle&
ENDPROC
CLS
VAR Edit1& = CreateEditCL(%HWND, "", 10,10,200,20,0,RGB(255,0,0) )
VAR Edit2& = CreateEditCL(%HWND, "", 10,40,200,20,0,RGB(205,0,0) )
VAR Edit3& = CreateEditCL(%HWND, "", 10,80,200,20,0,RGB(155,0,0) )
VAR Edit4& = CreateEditCL(%HWND, "", 10,120,200,20,0,RGB(105,0,0) )
VAR HEnde% = Create("BUTTON", %HWND, "Ende", 10,200,200,25)
VAR Ende% = 0
VAR i% = 0
WHILENOT Ende%
WAITINPUT
i% = i% + 1
IF CLICKED(HEnde%)
Ende% = 1
ENDIF
LOCATE 12,1
PRINT i%
WEND
SKCtrl_DeInitDll()
END
|
| | | Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 24.05.2011 ▲ |
| |
| | | | | | | |
| | Andreas Miethe
| Versuch's mal so KompilierenMarkierenSeparieren $H Windows.ph
DEF GetWindow(2) !"USER32","GetWindow"
DEF SK_GETFOCUS(1) GetWindow(&(1),5)
VAR PrgDir$ = GETDIR$("@")
VAR LVDLL& = USEDLL(PrgDir$ + "\\SKControl.dll")
$I SKCONTROL.INC
SKCtrl_InitDll()
PROC CreateEditCL
PARAMETERS ParentHandle&, Text$, x%, y%, dx%, dy%, TColor&, BColor&
DECLARE Handle&
DECLARE SKString#
DIM SKString#, 255
STRING SKString#, 0 = Text$
Handle& = SKCtrl_CreateColorEdit(ParentHandle&,SKString#,Tcolor&,BColor&,x%,y%,dx%,dy%,%hInstance)
SETSTYLE SK_GETFOCUS(Handle&), 0, GETSTYLE(SK_GETFOCUS(Handle&)) + $0000
DISPOSE SKString#
RETURN Handle&
ENDPROC
CLS
VAR Edit1& = CreateEditCL(%HWND, "", 10,10,200,20,0,RGB(255,0,0) )
SetStyle Edit1&, GetStyle(Edit1&) | ~WS_GROUP
VAR Edit2& = CreateEditCL(%HWND, "", 10,40,200,20,0,RGB(205,0,0) )
VAR Edit3& = CreateEditCL(%HWND, "", 10,80,200,20,0,RGB(155,0,0) )
VAR Edit4& = CreateEditCL(%HWND, "", 10,120,200,20,0,RGB(105,0,0) )
VAR HEnde% = Create("BUTTON", %HWND, "Ende", 10,200,200,25)
VAR Ende% = 0
VAR i% = 0
AddHotKey 1000, $09, 0
AddHotKey 1001, $0D, 0
WHILENOT Ende%
WAITINPUT
If IsKey($09) Or IsKey($0D)
SetFocus(~GetNextDlgGroupItem(%hwnd,%Getfocus,0))
Endif
IF CLICKED(HEnde%)
Ende% = 1
ENDIF
WEND
SKCtrl_DeInitDll()
END
|
| | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 24.05.2011 ▲ |
| |
| | Stephan Sonneborn | Hallo Andreas,
vielen Dank, da wäre ich nie drauf gekommen!
Super!!! |
| | | Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 24.05.2011 ▲ |
| |
| | Stephan Sonneborn | Andreas Miethe (24.05.11)
Versuch's mal so
Hallo Andreas,
ich hab noch eine Denksportaufgabe für Dich: Wie stelle ich es an, jeweils in zwei getrennten Parent-Handles basierte Edits einzufangen und zwar mit einer Waitinput-Schleife? KompilierenMarkierenSeparieren $H Windows.ph
DEF GetWindow(2) !"USER32","GetWindow"
DEF SK_GETFOCUS(1) GetWindow(&(1),5)
VAR PrgDir$ = GETDIR$("@")
VAR LVDLL& = USEDLL(PrgDir$ + "\\SKControl.dll")
$I SKCONTROL.INC
SKCtrl_InitDll()
PROC CreateEditCL
PARAMETERS ParentHandle&, Text$, x%, y%, dx%, dy%, TColor&, BColor&
DECLARE Handle&
DECLARE SKString#
DIM SKString#, 255
STRING SKString#, 0 = Text$
Handle& = SKCtrl_CreateColorEdit(ParentHandle&,SKString#,Tcolor&,BColor&,x%,y%,dx%,dy%,%hInstance)
SETSTYLE SK_GETFOCUS(Handle&), 0, GETSTYLE(SK_GETFOCUS(Handle&)) + $0000
DISPOSE SKString#
RETURN Handle&
ENDPROC
CLS
VAR GB1% = Create("Groupbox", %HWND, "1", 5,5,220,80)
VAR Edit1& = CreateEditCL(GB1%, "", 10,20,200,20,0,RGB(255,0,0) )
SetStyle Edit1&, GetStyle(Edit1&) | ~WS_GROUP
VAR Edit2& = CreateEditCL(GB1%, "", 10,50,200,20,0,RGB(205,0,0) )
VAR GB2% = Create("Groupbox", %HWND, "2", 5,100,220,80)
VAR Edit3& = CreateEditCL(GB2%, "", 10,20,200,20,0,RGB(155,0,0) )
SetStyle Edit3&, GetStyle(Edit3&) | ~WS_GROUP
VAR Edit4& = CreateEditCL(GB2%, "", 10,50,200,20,0,RGB(105,0,0) )
VAR HEnde% = Create("BUTTON", %HWND, "Ende", 10,200,200,25)
VAR Ende% = 0
VAR i% = 0
AddHotKey 1000, $09, 0
AddHotKey 1001, $0D, 0
WHILENOT Ende%
WAITINPUT
If IsKey($09) Or IsKey($0D)
SetFocus(~GetNextDlgGroupItem(GB1%,%Getfocus,0))
'SetFocus(~GetNextDlgGroupItem(GB2%,%Getfocus,0))
Endif
IF CLICKED(HEnde%)
Ende% = 1
ENDIF
WEND
SKCtrl_DeInitDll()
END
|
| | | Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 24.05.2011 ▲ |
| |
| | Andreas Miethe
| Eventuell so ?
Du könntest natürlich auch die Pfeiltasten zum Wechseln benutzen KompilierenMarkierenSeparieren $H Windows.ph
DEF GetWindow(2) !"USER32","GetWindow"
DEF SK_GETFOCUS(1) GetWindow(&(1),5)
VAR PrgDir$ = GETDIR$("@")
VAR LVDLL& = USEDLL(PrgDir$ + "\\SKControl.dll")
$I SKCONTROL.INC
SKCtrl_InitDll()
PROC CreateEditCL
PARAMETERS ParentHandle&, Text$, x%, y%, dx%, dy%, TColor&, BColor&
DECLARE Handle&
DECLARE SKString#
DIM SKString#, 255
STRING SKString#, 0 = Text$
Handle& = SKCtrl_CreateColorEdit(ParentHandle&,SKString#,Tcolor&,BColor&,x%,y%,dx%,dy%,%hInstance)
SETSTYLE SK_GETFOCUS(Handle&), 0, GETSTYLE(SK_GETFOCUS(Handle&)) + $0000
DISPOSE SKString#
RETURN Handle&
ENDPROC
CLS
VAR GB1% = Create("Groupbox", %HWND, "1", 5,5,220,80)
VAR Edit1& = CreateEditCL(GB1%, "", 10,20,200,20,0,RGB(255,0,0) )
SetStyle Edit1&, GetStyle(Edit1&) | ~WS_GROUP
VAR Edit2& = CreateEditCL(GB1%, "", 10,50,200,20,0,RGB(205,0,0) )
VAR GB2% = Create("Groupbox", %HWND, "2", 5,100,220,80)
VAR Edit3& = CreateEditCL(GB2%, "", 10,20,200,20,0,RGB(155,0,0) )
SetStyle Edit3&, GetStyle(Edit3&) | ~WS_GROUP
VAR Edit4& = CreateEditCL(GB2%, "", 10,50,200,20,0,RGB(105,0,0) )
VAR HEnde% = Create("BUTTON", %HWND, "Ende", 10,200,200,25)
VAR Ende% = 0
VAR i% = 0
AddHotKey 1000, $09, 0
AddHotKey 1001, $0D, 0
Var Lastgroup& = 0
WHILENOT Ende%
WAITINPUT
If IsKey($0D)
If LastGroup& = Gb1%
SetFocus(~GetNextDlgGroupItem(GB1%,%Getfocus,0))
else
SetFocus(~GetNextDlgGroupItem(GB2%,%Getfocus,0))
endif
Endif
If IsKey($09)
If LastGroup& = Gb1%
SetFocus(Edit3&)
Lastgroup& = Gb2%
else
SetFocus(Edit1&)
Lastgroup& = Gb1%
Endif
Endif
IF CLICKED(HEnde%)
Ende% = 1
ENDIF
WEND
SKCtrl_DeInitDll()
END
|
| | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 25.05.2011 ▲ |
| |
| | Stephan Sonneborn | Andreas Miethe (25.05.11)
Eventuell so ?
Hallo Andreas,
super Idee! Ich habs noch ein bißchen erweitert und jetzt ists auch egal, in welche Listbox man klickt. Mit Enter kommt man ins nächste Edit-Feld (innerhalb der Groupbox) und mit TAB in die nächste Groupbox. KompilierenMarkierenSeparieren $H Windows.ph
DEF GetWindow(2) !"USER32","GetWindow"
DEF SK_GETFOCUS(1) GetWindow(&(1),5)
VAR PrgDir$ = GETDIR$("@")
VAR LVDLL& = USEDLL(PrgDir$ + "\\SKControl.dll")
$I SKCONTROL.INC
SKCtrl_InitDll()
PROC CreateEditCL
PARAMETERS ParentHandle&, Text$, x%, y%, dx%, dy%, TColor&, BColor&
DECLARE Handle&
DECLARE SKString#
DIM SKString#, 255
STRING SKString#, 0 = Text$
Handle& = SKCtrl_CreateColorEdit(ParentHandle&,SKString#,Tcolor&,BColor&,x%,y%,dx%,dy%,%hInstance)
SETSTYLE SK_GETFOCUS(Handle&), 0, GETSTYLE(SK_GETFOCUS(Handle&)) + $0000
DISPOSE SKString#
RETURN Handle&
ENDPROC
CLS
VAR GB1% = Create("Groupbox", %HWND, "1", 5,5,220,80)
VAR Edit1& = CreateEditCL(GB1%, "", 10,20,200,20,0,RGB(255,0,0) )
SetStyle Edit1&, GetStyle(Edit1&) | ~WS_GROUP
VAR Edit2& = CreateEditCL(GB1%, "", 10,50,200,20,0,RGB(205,0,0) )
VAR GB2% = Create("Groupbox", %HWND, "2", 5,100,220,80)
VAR Edit3& = CreateEditCL(GB2%, "", 10,20,200,20,0,RGB(155,0,0) )
SetStyle Edit3&, GetStyle(Edit3&) | ~WS_GROUP
VAR Edit4& = CreateEditCL(GB2%, "", 10,50,200,20,0,RGB(105,0,0) )
VAR HEnde% = Create("BUTTON", %HWND, "Ende", 10,200,200,25)
VAR Ende% = 0
VAR i% = 0
AddHotKey 1000, $09, 0
AddHotKey 1001, $0D, 0
Var Lastgroup& = 0
WHILENOT Ende%
WAITINPUT
Lastgroup& = ~GetParent(~GetParent(%Getfocus))
If IsKey($0D)
If LastGroup& = Gb1%
SetFocus(~GetNextDlgGroupItem(GB1%,%Getfocus,0))
else
SetFocus(~GetNextDlgGroupItem(GB2%,%Getfocus,0))
endif
Endif
If IsKey($09)
If LastGroup& = Gb1%
SetFocus(Edit3&)
Lastgroup& = Gb2%
else
SetFocus(Edit1&)
Lastgroup& = Gb1%
Endif
Endif
IF CLICKED(HEnde%)
Ende% = 1
ENDIF
WEND
SKCtrl_DeInitDll()
END
|
| | | Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 25.05.2011 ▲ |
| |
|
AntwortenThemenoptionen | 5.134 Betrachtungen |
ThemeninformationenDieses Thema hat 3 Teilnehmer: |