Cleanup of code
[openwide.git] / owUtil.h
blob4d0d2734df13901931eaa9e9148b95fba23fe4af
1 /*
2 * Openwide -- control Windows common dialog
3 *
4 * Copyright (c) 2000 Luke Hudson
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef OW_UTIL_H
24 #define OW_UTIL_H
26 #include <windows.h>
28 enum PromptFileNameMode {OPEN, SAVE};
31 #define RCWIDTH(r) ((r).right - (r).left + 1)
32 #define RCHEIGHT(r) ((r).bottom - (r).top + 1)
34 #define WM_TRAYICON (WM_APP+1)
36 extern HWND ghwMain, ghwPropSheet;
37 extern HINSTANCE ghInstance;
38 extern POWSharedData gPowData;
39 extern HANDLE ghSharedMem;
40 extern HANDLE ghMutex;
41 extern HICON ghIconLG, ghIconSm;
44 /* Copied on : Tue Jul 12 19:04:19 2005 */
45 int Add_TrayIcon(HICON hIcon, char *szTip, HWND hwnd, UINT uMsg, DWORD dwState);
46 static int AddRem_TrayIcon(HICON hIcon, char *szTip, HWND hwnd, UINT uMsg, DWORD dwState, DWORD dwMode);
47 int cbAddString(HWND hwCB, const char *szStr, LPARAM lpData);
48 HRESULT CreateLink(LPCSTR lpszPathObj, LPCSTR lpszPathLink, LPCSTR lpszDesc);
49 BOOL delFile(HWND hwnd, const char *szFile);
50 int dlgUnits2Pix(HWND hwnd, int units, BOOL bHorz);
51 void EndTrayOperation(void);
52 void Error(char *szError, ...);
53 BOOL fileExists (const char *path);
54 int getDlgItemRect(HWND hwnd, UINT uID, LPRECT pr);
55 TCHAR *lbGetItemText(HWND hwLB, int iItem);
56 int pix2DlgUnits(HWND hwnd, int pix, BOOL bHorz);
57 char *Prompt_File_Name(int iFlags, HWND hwOwner, const char *pszFilter, const char *pszTitle);
58 void releaseMutex(void);
59 int Rem_TrayIcon(HWND hwnd, UINT uMsg, DWORD dwState);
60 BOOL waitForMutex(void);
62 #endif