Hi there,
below is a code snippet which embeds the Explorer in a DDT dailog.
Pls let me know what you think about it.
rgds
Ralph
------------------
below is a code snippet which embeds the Explorer in a DDT dailog.
Pls let me know what you think about it.
rgds
Ralph
Code:
$COMPILE EXE $REGISTER NONE $INCLUDE "WIN32API.INC" FUNCTION cbEnum(BYVAL hWnd AS LONG, lpszTitle AS ASCIIZ PTR) AS LONG GetWindowText hWnd, @lpszTitle, 256 IF INSTR(@lpszTitle, "Explorer") THEN @lpszTitle = STR$(hWnd) FUNCTION = %false EXIT FUNCTION END IF FUNCTION = %true END FUNCTION CALLBACK FUNCTION dlg_main LOCAL szTitle AS ASCIIZ * 256 LOCAL styleSearch AS LONG LOCAL R AS Rect STATIC hwndSearch AS LONG SELECT CASE CBMSG CASE %WM_initdialog ' try with iexplorer ' SHELL "C:\Programme\Internet Explorer\Iexplore.exe" ' apisleep 2000 ''' hardcoded path pls modify SHELL "C:\WinNt\explorer.exe" ''' give explorer time to start apisleep 500 ''' find the explorer window handle EnumWindows CODEPTR(cbEnum), VARPTR( szTitle ) hwndSearch = VAL(szTitle) ''' make it parent of our dialog ' styleSearch = getwindowlong ( hwndSearch, %GWL_STYLE ) ' styleSearch = styleSearch OR %WS_CHILD Setwindowlong hwndSearch, %GWL_STYLE, %WS_CHILD OR %WS_VISIBLE ''styleSearch setparent hwndSearch, CBHNDL ''' cosmetics getclientrect CBHNDL, r SetWindowPos hwndSearch, %HWND_TOP, 0,0, r.nright-r.nleft, r.nbottom - r.ntop, %SWP_FRAMECHANGED CASE %WM_SIZE IF CBWPARAM = %SIZE_MINIMIZED THEN EXIT FUNCTION MoveWindow hwndSearch, 0, 0, LOWRD(CBLPARAM), HIWRD(CBLPARAM), %true END SELECT END FUNCTION FUNCTION PBMAIN AS LONG LOCAL hDlg AS LONG DIALOG NEW 0, "PB captures Explorer",,, 400,200, %WS_CAPTION OR %WS_SYSMENU OR %WS_THICKFRAME TO hdlg DIALOG SHOW MODAL hdlg CALL dlg_main MSGBOX "END" END FUNCTION
------------------
Comment