Verfasst: 09.06.2009 19:00
Sry aber sind da nich beispiel Codes dabei 

fehlt was?R4z0r1989 hat geschrieben:ne
C:\Programme\Logitech\GamePanel Software\LCD Manager\SDK\LCDSDK_3.02.173.zipR4z0r1989 hat geschrieben:vorkauen musst es mir nicht aber was unter device und was für ein pointer da hin muss wäre ne dufte sache weil ich als return nur immer ne schöne 0 bekomm!
lglcd.pdf Seite 9 hat geschrieben: lgLcdDeviceDescEx
The lgLcdDeviceDescEx structure describes the properties of an attached device. This
lgLcdEnumerateEx().
information is returned through a call to
typedef struct
{
DWORD deviceFamilyId;
TCHAR deviceDisplayName[MAX_PATH];
DWORD Width;
DWORD Height;
DWORD Bpp;
DWORD NumSoftButtons;
DWORD Reserved1;
DWORD Reserved2;
} lgLcdDeviceDescEx;
Code: Alles auswählen
XIncludeFile "G15_Source.pb"
Global Device
Procedure MySoftButtonCallBack(device.l, dwButtons.l, *pContext)
;Callback which is being called, whenever a SoftButton is pressed
;(AND YOUR APPLICATION HAS THE FOCUS ON THE DISPLAY!)
If dwButtons & #LGLCDBUTTON_BUTTON0
StartDrawing(ImageOutput(0))
Box(5, #LGLCD_BMP_HEIGHT - 13, 20, 13, #White)
DrawText(5, #LGLCD_BMP_HEIGHT - 13, "B1", 0)
StopDrawing()
lgLcdUpdateBitmap(Device, 0, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT))
Else
StartDrawing(ImageOutput(0))
Box(5, #LGLCD_BMP_HEIGHT - 13, 20, 13, #White)
StopDrawing()
lgLcdUpdateBitmap(Device, 0, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT))
EndIf
If dwButtons & #LGLCDBUTTON_BUTTON1
StartDrawing(ImageOutput(0))
Box(35, #LGLCD_BMP_HEIGHT - 13, 20, 13, #White)
DrawText(35, #LGLCD_BMP_HEIGHT - 13, "B2", 0)
StopDrawing()
lgLcdUpdateBitmap(Device, 0, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT))
Else
StartDrawing(ImageOutput(0))
Box(35, #LGLCD_BMP_HEIGHT - 13, 20, 13, #White)
StopDrawing()
lgLcdUpdateBitmap(Device, 0, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT))
EndIf
If dwButtons & #LGLCDBUTTON_BUTTON2
StartDrawing(ImageOutput(0))
Box(100, #LGLCD_BMP_HEIGHT - 13, 20, 13, #White)
DrawText(100, #LGLCD_BMP_HEIGHT - 13, "B3", 0)
StopDrawing()
lgLcdUpdateBitmap(Device, 0, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT))
Else
StartDrawing(ImageOutput(0))
Box(100, #LGLCD_BMP_HEIGHT - 13, 20, 13, #White)
StopDrawing()
lgLcdUpdateBitmap(Device, 0, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT))
EndIf
If dwButtons & #LGLCDBUTTON_BUTTON3
StartDrawing(ImageOutput(0))
Box(130, #LGLCD_BMP_HEIGHT - 13, 20, 13, #White)
DrawText(130, #LGLCD_BMP_HEIGHT - 13, "B4", 0)
StopDrawing()
lgLcdUpdateBitmap(Device, 0, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT))
Else
StartDrawing(ImageOutput(0))
Box(130, #LGLCD_BMP_HEIGHT - 13, 20, 13, #White)
StopDrawing()
lgLcdUpdateBitmap(Device, 0, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT))
EndIf
EndProcedure
Procedure main()
Protected ctx.lgLcdConnectContext, ctxo.lgLcdOpenContext
If lgLcdInit(#LGLCD_INIT_NORMAL) = #ERROR_SUCCESS
ctx\appFriendlyName = @"ahkdweukuhkj"
ctx\isPersistent = #False
ctx\isAutostartable = #False
If lgLcdConnect(@ctx) <> #ERROR_SUCCESS
lgLcdDeInit()
Else
ctxo\connection = ctx\connection
ctxo\index = 0
ctxo\onSoftbuttonsChanged\softbuttonsChangedCallback = @MySoftButtonCallBack()
If lgLcdOpen(@ctxo) <> #ERROR_SUCCESS
lgLcdDisconnect(ctx\connection)
lgLcdDeInit()
Else
Device = ctxo\Device
CreateImage(0, #LGLCD_BMP_WIDTH, #LGLCD_BMP_HEIGHT, 8)
StartDrawing(ImageOutput(0))
FillArea(0, 0, -1, #White)
DrawText((#LGLCD_BMP_WIDTH - TextWidth("Press Softbuttons")) / 2, 10, "Press Softbuttons", 0)
StopDrawing()
If lgLcdUpdateBitmap(ctxo\Device, 0, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT)) = #ERROR_SUCCESS
lgLcdSetAsLCDForegroundApp(ctxo\Device, #LGLCD_LCD_FOREGROUND_APP_YES)
EndIf
OpenWindow(0, 250, 250, 220, 44, "Example", #PB_Window_SystemMenu)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
lgLcdClose(ctxo\Device)
lgLcdDisconnect(ctx\connection)
lgLcdDeInit()
FreeImage(0)
EndIf
EndIf
EndIf
EndProcedure
main()