#ifndef _SBPLUGIN_ #define _SBPLUGIN_ //---------------------------------------------------------------------- //messages for sbrunscr plugins //plagin export function //BOOL CALLBACK WINAPI __declspec(dllexport) SBRunSrc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) //hwnd - HANDLE Main window of SBRunSrc - use for send message //msg - messages from SBRunSrc: //---------------------------------------------------------------------- #define SBCREATE 0 //WPARAM 0, LPARAM (char *) language ini file; plagin must return HANDLE of main dialog #define SBSETTINGS 1 //WPARAM 0, LPARAM (char *) user settings ini file #define SBGETCOUNTHOTKEY 2 //WPARAM 0, LPARAM 0; plagin must return count hot key #define SBGETHOTKEY 3 //WPARAM i - number hotkey, LPARAM IDhotkey; plugin return point to SHotKey #define SBRUNHOTKEY 4 //WPARAM 0, LPARAM IDhotkey set on SBGETHOTKEY #define SBSTOPNEXTWALL 5 //WPARAM 0, LPARAM 0; plugin must return TRUE if need stop change wallpaper #define SBGETCOUNTMENUITEM 6 //WPARAM 0, LPARAM 0; plugin must return count item in main popup menu #define SBGETMENUITEM 7 //WPARAM i - number menu item, LPARAM IDmenuitem; plugin return point to SMenuItem #define SBCREATEMENUITEM 8 //hwnd - HMENU, WPARAM 0, LPARAM IDmenuitem; plagin can change item #define SBCREATEMENUITEMPOPUP 9 //hwnd - HMENU, WPARAM i - position on menu, LPARAM IDmenuitem; plagin can add popup menu #define SBRUNMENUITEM 10 //hwnd - HMENU, WPARAM 0, LPARAM IDmenuitem #define SBAPPLICATIONCLOSE 11 //WPARAM 0, LPARAM 0; when close application #define SBAPPLICATIONCLEAR 12 //WPARAM 0, LPARAM 0; when clear settings application #define SBSTOPPREVIOUSWALL 13 //WPARAM 0, LPARAM 0; plugin return TRUE if need stop change wallpaper #define SBUPDATEWALL 14 //WPARAM 0, LPARAM 0; plugin return TRUE if need stop update wallpaper #define SBSTOPICONRULE 15 //WPARAM 0, LPARAM 0; plugin return TRUE if need stop managing desktop icon #define SBCREATEWALLPAPER 16 //WPARAM 0, LPARAM HDC for correct image #define SBCMDRUN 17 //WPARAM point to char, LPARAM 0; plugin return new point to char with delete command usage or (NULL/FALSE) #define SBPOPMENU 18 //hwnd - HMENU plagin popup menu created when SBCREATEMENUITEMPOPUP message, WPARAM - WPARAM from popup menu, LPARAM 0 #define SBCHANGEDATE 19 //WPARAM 0, LPARAM 0; when date changed for reinitializing plagin if necessary #define SBGETCOLORDATE 20 //WPARAM point to char number month["01",...,"12"], LPARAM point to char number day["01",...,"31"]; //plagin must return COLORREF (>0,<16777215) for change color of date on calendar #define SBLISTCHANGE 21 //WPARAM 0, LPARAM 0; when list of list files changed #define SBGETCOLORBORDERDATE 22 //WPARAM point to char number month["01",...,"12"], LPARAM point to char number day["01",...,"31"]; //plagin must return COLORREF (>0,<16777215) for change border color of date on calendar #define SBGETDESCRIPTION 23 //WPARAM 0, LPARAM (char *) language ini file; plagin must return memory buffer string with description //---------------------------------------------------------------------- typedef struct s_menuitem { char *NameMenuItem; //Name menu item char *KeyMenuItem; //Name menu item in user settings ini file } SMenuItem; typedef struct menudata { char text[MAX_PATH]; //Text of menu item HICON hIcon; //HICON of menu item void *data; //additional custom data } MenuData; typedef struct s_hotkey { char *DescroptionHotKey; //Descroption of hotkey char *KeyWin; //Name of key win in user settings ini file char *KeyHotKey; //Name of key hotkey in user settings ini file } SHotKey; //---------------------------------------------------------------------- //Sending message to Main window of SBRunSrc //SendMessage(HANDLE Main window of SBRunSrc, WM_USER+2, msg, LPARAM) //msg - messages to SBRunSrc: //---------------------------------------------------------------------- #define SBLOCKWORCSTATION 0 //LPARAM 0 #define SBSAVEPICTURE 1 //LPARAM - point to SSavePicture #define SBNEXTWALL 2 //LPARAM 0; change wallpaper #define SBADDTOOLTIP 3 //LPARAM - point to SAddToolTip #define SBSETLAYEREDWINDOW 4 //LPARAM - point to SSetLayeredWin #define SBCHOOSEFONT 5 //LPARAM - point to SChooseFont #define SBPLACEFUNC 6 //LPARAM - point to SPlaceFunc #define SBGETCPUUSAGE 7 //LPARAM 0 #define SBLOADPICTURE 8 //LPARAM - point to SLoadPicture; return point to Img object #define SBIMGCTXTOBMP 9 //LPARAM - point to SImgToBMP; return point to HBITMAP #define SBCLEARPICTURE 10 //LPARAM - point to Img object for clear memory #define SBSCALEBITMAP 11 //LPARAM - point to SScaleBitMap; return point to HBITMAP #define SBSHOWSETTINGS 12 //LPARAM - HANDLE of window of plagin or NULL #define SBTRACKMENU 13 //LPARAM - HMENU plagin menu for show #define SBGETMAINMENU 14 //LPARAM 0; return HANDLE Main Menu #define SBSETUPDATEWALL 15 //LPARAM 0; update wallpaper #define SBIMGCTXTOSMALLBMP 16 //LPARAM - point to SImgToSmallBMP; function automatic clear Img object #define SBINPUTDIALOG 17 //LPARAM - point to SInputInitParam, which make by malloc, because free afte init dialog; //return point to char #define SBGETINETFILE 18 //LPARAM - point to SGetInetFile #define SBDRAWBIT 19 //LPARAM - point to SDrawBit #define SBCHECKMAINMENUITEM 20 //LPARAM - point to SCheckMainMenuItem #define SBRUNCMD 21 //LPARAM - point to char cmd line #define SBGETPARENTMAIN 22 //LPARAM 0; return HANDLE of parent of main window of sbrunscr for create window //without button on taskbar #define SBCANCELWORK 23 //LPARAM 0; check 'Cancelling automatic work'; return FALSE if cancel #define SBGETWALLPAPER 24 //LPARAM 0; return *char current wallpaper #define SBGETSCREENSAVER 25 //LPARAM 0; return *char current screensaver #define SBSELFOLDER 26 //LPARAM - point to SSelFolder; return point to char #define SBSELFILE 27 //LPARAM - point to SSelFile; return point to char #define SBADDFILES 28 //LPARAM - point to SFileToList #define SBDELFILES 29 //LPARAM - point to SFileToList #define SBGETNEXTWALLPAPER 30 //LPARAM 0; return *char current wallpaper #define SBDRAWCALENDAR 31 //LPARAM - point to SDrawCalendar #define SBGETHOTKEYVALUE 32 //LPARAM - ID hotkey //---------------------------------------------------------------------- typedef struct s_savepicture { char *namefile; //name of file HBITMAP hBit; //HBITMAP } SSavePicture; typedef struct s_addtooltip { HWND hWnd; //HANDLE window for tooltip UINT nIDTool; //ID control for tooltip UINT nIDStr; //NumKey from language file in section "TOOLTIP" } SAddToolTip; typedef struct s_setlayeredwin { HWND hwnd; //HANDLE window COLORREF crKey; //Transparency color BYTE bAlpha; //Alpha value of transparency DWORD dwFlags; //Flags: LWA_COLORKEY, LWA_ALPHA } SSetLayeredWin; typedef struct s_choosefont { char *ext; //extention settings file char *app; //AppName in settings file HWND H; //HANDLE window with control int ID; //ID control char *keyStyle; //key name for Style in settings file char *keyCharset; //key name for Charset in settings file char *keyFontBox; //key name for Font in settings file BOOL reg; //if TRUE, settings been saved } SChooseFont; typedef struct s_placefunc { BYTE PlaceDialogType; //1 - rectangle; 2 - type define by combobox ID control current value; 3 - upper left corner HWND hPlaceDialogType; //HANDLE window with control int IDpx; //edit ID control for X position dialog int IDpy; //edit ID control for Y position dialog int IDTypePos; //combobox ID control for type position dialog include items //(0 - lower left corner; 1 - lower right corner; 2 - upper left corner; 3 - upper right corner) int Width; //Width of position dialog int Height; //Height of position dialog } SPlaceFunc; typedef struct s_loadpicture { SIZE *Sw; //return to Sw - size of picture char *name; //file name of picture for loading } SLoadPicture; typedef struct s_imgtobmp { void *LoadedImage; //point to Img object SIZE *So; //source size of image SIZE *Sn; //result size of image BOOL bBorder; //for Drawing border around picture int iColBorder; //color of border int iThickBoder; //thickness of border } SImgToBMP; typedef struct s_scalebitmap { HBITMAP hBitTemp; //source HBITMAP int *wNewWidth; //new Width int *wNewHeight; //new Height char *nameBUF; //name file without extension and without path for scale operation } SScaleBitMap; typedef struct s_imgtosmallbmp { HWND HPic; //HANDLE window, which necessary will update HBITMAP *hBit; //point to HBITMAP - result of work function void *LoadedImage; //point to Img object SIZE *Sw; //source size of image } SImgToSmallBMP; typedef struct s_inputInitParam { HWND hwnd; //HANDLE of parent window int iCaption; //key namber from ini language file STRING section for caption dialog int iTitle; //key namber from ini language file STRING section for information char *inText; //point to char for default value of param BOOL yInt; //1 - if parament must be integer } SInputInitParam; typedef struct s_getinetfile { char *url; //URL to http file with "http://" prefix char *sstop; //stop string for break dounload BOOL bError; //if TRUE, be showing error message BYTE btype; //type loading: // 0 - loading to string returning by function, necessary Lread param - for return length of string loading // 1 - loading to file; necessary sfout(name file for save loading source) or Fout // 2 - loading to file by pSaveRez function; necessary pSaveRez and (sfout or Fout) int *Lread; char *sfout; FILE *Fout; void (* pSaveRez) (FILE *Fout, char *sRet, int iByteRet); } SGetInetFile; typedef struct s_drawbit { HDC hDC; //HDC when drawing image HBITMAP hBit; //HBITMAP image for drawing int xbit; int ybit; //x and y position image on HDC int wbit; int hbit; //width and height image on HDC BYTE trans; //if 1 - use generate transparency by color in Angle on HDC float alpha; //alpha-transparency of image on HDC: 0 - min alpha-transparency; 1 - max BYTE otnpos; //relative position image on HDC by xbit and ybit //(0 - lower left corner; 1 - lower right corner; 2 - upper left corner; 3 - upper right corner) BYTE RevCol; //reverse color HDC on point RGB(255,255,255) BYTE Tolerance; //Tolerance of transparency: 0 - 100 BYTE Angle; //Angle by select color transparency int TransCol; //Color of transparency } SDrawBit; typedef struct s_checkmainmenuitem { int ID; //ID Menu Item BOOL Check; //if True - Check Menu Item } SCheckMainMenuItem; typedef struct s_selfolder { HWND hwnd; //Handle parent window char *TempDir; //Default folder on open selfolder dialog char *R; //Help string in selfolder dialog } SSelFolder; typedef struct s_selfile { HWND howner; //Handle parent window char *filter; //like OPENFILENAME.lpstrFilter element char *title; //Header of selfile dialog char *ext; //Default Extension for SaveType dialog BOOL OpenSave; //If TRUE - OpenType dialog, ELSE - SaveType dialog } SSelFile; typedef struct s_file {char *name; struct s_file * psb;} SFile; typedef struct s_filetolist { SFile *sb; //point to SFile char *namelist; //name of list - name of file in "Lists" folder without extension } SFileToList; typedef struct s_month {int PosX; int PosY; BYTE Scale; int imonth; int iyear;} SMonth; typedef struct s_drawcalendar { HDC hDC; //HDC for drawing SMonth *mm; char *syear; char *smonth; } SDrawCalendar; //---------------------------------------------------------------------- #endif