Hi Jaafar
it is possible, but .. there we go again.. only with api's
michel pierron has published a few examples for msgbox positioning that
you may want to adapt to your dialog situation.
and ofcourse you;ll need to add some code
to read the screensize,dialogsize and compute the new x,y of the dialog
iso hardcoding it like in next example:
michel is apt to replace the constants with numbers..
making it a bit harder to see what he does
he SETS the hook with &H5,
read that as WH_CBT (window hook computer based training)
his WinProc reacts to lMsg=5
read that as HCBT_ACTIVATE the hooked window is being Activated..
he moves the window with &H15
read that as SWP_NOSIZE OR SWP_NOZORDER OR SWP_NOACTIVATE
Private Declare Function UnhookWindowsHookEx Lib "user32" _
(ByVal hHook As Long) As Long
Private Declare Function GetCurrentThreadId Lib "kernel32" () As Long
Private Declare Function SetWindowsHookEx Lib "user32" Alias _
"SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long _
, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long _
, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long _
, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private lgHook As Long
Sub Positionned_MsgBox()
lgHook = SetWindowsHookEx(&H5, AddressOf WinProc, 0, GetCurrentThreadId)
MsgBox "Special msgbox (Left = 100 / Top = 100) !", 64
End Sub
Private Function WinProc(ByVal lMsg As Long, ByVal wParam As Long) As
Long
If lMsg = 5 Then
SetWindowPos wParam, 0, 100, 100, 0, 0, &H15
UnhookWindowsHookEx lgHook
End If
WinProc = False
End Function
--
keepITcool
|
www.XLsupport.com | keepITcool chello nl | amsterdam
RAFAAJ2000 wrote :