Hier ist mal ne kleine Sammlung von Funktionen von mir (hatte für PB 3.93 acuh ne lib daraus gemacht).
Die Procedurenamen sollten ja für sich sprechen!
Code: Alles auswählen
#CCHILDREN_TITLEBAR = 5
Structure CN_TITLEBARINFO
cbSize.l
rcTitleBar.RECT
rgstate.l[#CCHILDREN_TITLEBAR+1]
EndStructure
Structure _HOSTENT
h_name.l
h_aliases.l
h_addrtype.w
h_length.w
h_addr_list.l
EndStructure
ProcedureDLL.s GetIPbyHostName(Hostname.s) ; returns you IP
pHostinfo = gethostbyname_(Hostname)
CopyMemory (pHostinfo, hostinfo._HOSTENT, SizeOf(_HOSTENT))
If hostinfo\h_addrtype <> #AF_INET
MessageRequester("Info","A non-IP address was returned", 0)
Else
While PeekL(hostinfo\h_addr_list+AdressNumber * 4)
ipAddress = PeekL(hostinfo\h_addr_list + AdressNumber * 4)
TheIPAdress$ = StrU(PeekB(ipAddress), 0) + "." + StrU(PeekB(ipAddress+1), 0) + "." +StrU(PeekB(ipAddress+2), 0) + "." + StrU(PeekB(ipAddress+3), 0)
AdressNumber + 1
Wend
EndIf
ProcedureReturn TheIPAdress$
EndProcedure
ProcedureDLL GetStatusbarHeight(StatusBarHandle.l) ; Returns the Statusbar height
GetClientRect_(StatusBarHandle,@stbRect.RECT)
ProcedureReturn stbRect\bottom
EndProcedure
ProcedureDLL GetToolBarHeight(ToolBarHandle.l) ; Returns the Toolbar height
GetClientRect_(ToolBarHandle,@tbSize.RECT)
ProcedureReturn tbSize\bottom
EndProcedure
ProcedureDLL.s GetApplicationPath() ;Returns the path of the application
Path.s = Space(1024)
GetCurrentDirectory_(1024, @Path.s)
Path = Path + "\"
ProcedureReturn Path
EndProcedure
ProcedureDLL GetTitelBarHeight(WindowHandle.l) ; Returns the Titlebar height
title.CN_TITLEBARINFO
title\cbSize = SizeOf(CN_TITLEBARINFO)
title\rgstate = 0
GetTitleBarInfo_(WindowHandle,@title)
top_pos = title\rcTitleBar\top
bottom_pos = title\rcTitleBar\bottom
titlebarheight = bottom_pos - top_pos
ProcedureReturn titlebarheight
EndProcedure
ProcedureDLL SetGadgetBorderless(gadget.l) ; Set many of Gadgets Borderless
Shared GadgetHandle.l
If IsGadget(gadget)
GadgetHandle = GadgetID(gadget)
ActStyle = GetWindowLong_(GadgetHandle, #GWL_EXSTYLE)
newstyle = ActStyle &(~#WS_EX_CLIENTEDGE)
SetWindowLong_(GadgetHandle, #GWL_EXSTYLE, newstyle)
SetWindowPos_(GadgetHandle, 0, 0, 0, 0, 0, #SWP_SHOWWINDOW | #SWP_NOSIZE | #SWP_NOMOVE | #SWP_FRAMECHANGED)
GetClientRect_(GadgetHandle,GadgetRect.RECT)
RedrawWindow_(GadgetHandle,GadgetRect,0,#RDW_INVALIDATE|#RDW_ERASE)
EndIf
EndProcedure
ProcedureDLL GetTaskBarHeight() ;Return the Taskbarheight
task.RECT
htask = FindWindow_("Shell_TrayWnd", 0)
GetWindowRect_(htask,task)
task_height = task\bottom - task\top
ProcedureReturn task_height
EndProcedure
ProcedureDLL GetWorkAreaWidth() ;returns the work area width
SystemParametersInfo_(#SPI_GETWORKAREA,0,Disp.RECT,0)
ProcedureReturn Disp\right
EndProcedure
ProcedureDLL GetWorkAreaHeight() ;returns the work area height
SystemParametersInfo_(#SPI_GETWORKAREA,0,Disp.RECT,0)
ProcedureReturn Disp\bottom
EndProcedure
Für dich sollte da die Procedure
GetTaskBarHeight() das sein was du brauchst.
Gruß,
Nico