1. copy ke global ext. functions:

Function long WinExec(String acmd, uint Show_Mode)
library 'kernel32.dll' 
FUNCTION boolean CloseWindow(ulong w_handle) LIBRARY
"User32.dll" 
Function long ShowWindow(long l_hwnd, int nCmdShow)
library 'user32.dll' 
FUNCTION ulong FindWindowA(ulong classname,string
windowname) LIBRARY "User32.dll" 
FUNCTION boolean BringWindowToTop(  ulong  HWND  )
Library "user32.dll"
FUNCTION boolean GetUserNameA( ref string userID, ref
ulong len ) library "ADVAPI32.DLL"
SUBROUTINE keybd_event( int bVk, int bScan, int
dwFlags, int dwExtraInfo) LIBRARY "user32.dll" 
FUNCTION boolean MoveWindow(ulong whand,int wx,int
wy,int ww,int wh,boolean wflag) LIBRARY "user32.dll" 
Function boolean CloseHandle(ulong mutexhandle)
library 'KERNEL32.DLL' 
FUNCTION long GetWindowTextA(long hWnd, ref string
lpString, long nMaxCount) Library "user32.dll"
Function long GetWindow(long hwnd, long wCmd) Library
"user32.dll"
FUNCTION boolean GetKeyboardState(ref integer
kbarray[256])  LIBRARY "USER32.DLL" 
FUNCTION uint  GetKeyState( int nVirtKey) Library
"user32.dll"
FUNCTION boolean SetKeyboardState(ref integer
kbarray[256]) LIBRARY "USER32.DLL" 
FUNCTION uint GetWindowTextLengthA(long hWnd) Library
"user32.dll"
//Function ulong GetDC(ulong hwnd) library
"user32.dll" 
//FUNCTION boolean PostMessageA(ulong hwndle,UINT
wmsg,ulong wParam,ulong lParam) Library "User32.dll" 
//Function long GetActiveWindow()  Library
"user32.dll"
//Function long SendMessageA(long hWnd, uint msg,
string wparam, long lparam ) library 'user32.dll' 
//Function long GetModuleHandleA (string
alpszModuleName) library 'kernel32.dll' 
//Function Long CreateMutexA(string
alpMutexAttributes, boolean abInitialOwner, string
alpName) library 'kernel32.dll' 
//Function Long GetLastError() library 'kernel32.dll' 
//Function ulong GetCurrentDirectoryA (ulong textlen,
ref string dirtext) library 'KERNEL32.DLL' 
//function boolean CopyFileA(string
LpExistingFileName, string LpNewFileName, boolean
bFailfExists) library 'kernel32.dll' 
//function boolean MoveFileA(string
LpExistingFileName, string LpNewFileName) library
'kernel32.dll' 
//Function boolean SetCurrentDirectoryA (string
dirtext) library 'KERNEL32.DLL' 
//subroutine DragAcceptFiles(long l_hWnd,boolean
fAccept) library "shell32.dll" 
//subroutine DragFinish (long hDrop) library
"shell32.dll" 
//function int DragQueryFile(long hDrop, int iFile,
ref string szFileName, int cb) library "shell32.dll"


////////////////

2. buat function "f_findwindow" dgn parameter
"str_win" type "string". ini scriptnya:

long ll_handle
string ls_null
string sz_text_win

setnull(ls_null)

ll_handle = FindWindowA(0, "" ) 

do while ll_handle > 0
        if ll_handle > 0 then

                sz_text_win = space(255)
        
                GetWindowTextA( ll_handle, sz_text_win, 255 )
        
                if pos( upper(sz_text_win), upper(str_win) ) > 0
then
                        // ketemu...
                        return ( ll_handle )
                end if
        end if

        ll_handle = GetWindow( ll_handle, 2 )
loop

// gak ketemu juga...
return(0)


///////////////////////////

3. buat window dengan 2 tombol dengan judul "open" dan
"close".

4. untuk tombol open scriptnya: (contoh buat open
notepad.exe) ...

/////////////

long ii, jj
long ll_time
string sz_path='c:\windows\notepad.exe'


// chek for existing iq plus
ll_handle = f_findwindow( 'Notepad')

if ll_handle = 0 then // kalo gak ada jalankan...
        WinExec(sz_path, 1 ) // 1 = normal, 2 = min, 3 = max
end if

ll_handle = f_findwindow( 'Notepad') // pasti ada
donk... kan udah dibuka

///////////

5. untuk tombol closednya (ini dia), liat funct. no. 2
di global.

CloseWindow( ll_handle )

/////////////

6. gampang kan?

7. udah.

8. see u.

9. thx

10. Grûâ Got.






-del-

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/NhFolB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------
IndoPB - Indonesia PB User Group 
An Indonesian PowerBuilder User Group's Event
2nd PowerBuilder Update
Mezzanine Floor Hotel Ibis Slipi
26/27 August 2006
To Register : 
http://groups.yahoo.com/group/indopb/database?method=addRecord&tbl=4 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/indopb/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Kirim email ke