|
From: <ma...@us...> - 2002-12-26 15:13:58
|
Update of /cvsroot/mingw/utils/msys-here/winui/include
In directory sc8-pr-cvs1:/tmp/cvs-serv16093/winui/include
Modified Files:
winui.h
Log Message:
Merge WinUI changes
Index: winui.h
===================================================================
RCS file: /cvsroot/mingw/utils/msys-here/winui/include/winui.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** winui.h 22 Dec 2002 02:52:07 -0000 1.1.1.1
--- winui.h 26 Dec 2002 15:13:55 -0000 1.2
***************
*** 12,25 ****
#include <stdlib.h>
#include <time.h>
- // OLE support for CShellDlg.
#include <shlobj.h>
#include <commdlg.h>
#include <commctrl.h>
-
#include "CList.h"
! // TODO: ListView_SetExtendedListViewStyleEx not in the headers.
!
! /* NMMOUSE is missing in MinGW headers */
#ifdef __MINGW32__
typedef struct tagNMMOUSE {
--- 12,22 ----
#include <stdlib.h>
#include <time.h>
#include <shlobj.h>
#include <commdlg.h>
#include <commctrl.h>
#include "CList.h"
! // missing in MinGW headers: ListView_SetExtendedListViewStyleEx, NMMOUSE.
! // TODO: submit missing defines.
#ifdef __MINGW32__
typedef struct tagNMMOUSE {
***************
*** 48,71 ****
#define LPNMTVDISPINFO LPNMTVDISPINFOA
#endif
-
#endif /* __MINGW32__ */
! /* A few handy procedures. */
int MsgBox(HWND hWnd, UINT uType, char *lpCaption, const char *format, ...);
int debugf(const char *format, ...);
bool ClientToWindow(HWND hWnd, LPPOINT lpPoint);
! class CChrono {
public:
! CChrono();
! ~CChrono() {};
!
! void Start(void);
! DWORD Stop(void);
!
! protected:
! DWORD _time;
!
! private:
};
--- 45,87 ----
#define LPNMTVDISPINFO LPNMTVDISPINFOA
#endif
#endif /* __MINGW32__ */
!
! /* WinUI tools 1.0.
! TODO: should be moved to a dedicated module containing
! all tips and tricks. */
!
! // message box functions.
int MsgBox(HWND hWnd, UINT uType, char *lpCaption, const char *format, ...);
int debugf(const char *format, ...);
+
+ // converts the client coordinates of a point to window coordinates.
bool ClientToWindow(HWND hWnd, LPPOINT lpPoint);
! class CSingleInstance {
! /* Good trick from Redmond guys, to know
! if another instance of an application already
! exists.
!
! Reference: M$ KB (Q243953).
! Note: In order to use a local CSingleInstance,
! we don't call CloseHandle(). */
!
public:
! CSingleInstance(LPCTSTR uniqueID){
! _hMutex = ::CreateMutex(NULL, TRUE, uniqueID);
! _lastError = ::GetLastError();
! }
! ~CSingleInstance(){
! if (_hMutex)
! ::ReleaseMutex(_hMutex);
! }
! bool AlreadyExists(void){
! return (_lastError == ERROR_ALREADY_EXISTS);
! }
!
! private:
! HANDLE _hMutex;
! DWORD _lastError;
};
***************
*** 81,89 ****
};
- /* OLE Initialization */
class UseOle {
public:
! UseOle() {_oleError = OleInitialize(NULL);}
! ~UseOle() {OleUninitialize();}
HRESULT GetInitializeError(void) {return _oleError;}
--- 97,106 ----
};
class UseOle {
+ /* Automatic OLE Initialization. */
+
public:
! UseOle() {_oleError = ::OleInitialize(NULL);}
! ~UseOle() {::OleUninitialize();}
HRESULT GetInitializeError(void) {return _oleError;}
***************
*** 93,98 ****
};
! // Forward declaration of CWindow.
! class CWindow;
--- 110,130 ----
};
! class CChrono {
! /* A simple chrono. */
!
! public:
! CChrono() : _time(0) {};
! ~CChrono() {};
!
! void Start(void) {_time = ::GetTickCount();}
! DWORD Stop(void){
! DWORD diff = ::GetTickCount() - _time;
! _time = 0;
! return diff;
! }
!
! protected:
! DWORD _time;
! };
***************
*** 416,434 ****
LPSTR lpCmdLine;
int nCmdShow;
-
- char appName[64];
char msgBuf[256];
! bool Init(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
! int nCmdShow);
! bool SetName(char * name, char * version = NULL);
bool IsWinNT(void);
!
! bool ChangeDirectory(char * dir);
protected:
bool _bWinNT;
-
- private:
};
--- 448,460 ----
LPSTR lpCmdLine;
int nCmdShow;
char msgBuf[256];
! bool Init(HINSTANCE hInstance, HINSTANCE hPrevInstance,
! LPSTR lpCmdLine, int nCmdShow);
bool IsWinNT(void);
! bool ChangeDirectory(char *dir);
protected:
bool _bWinNT;
};
***************
*** 452,458 ****
};
! // Forward declaration.
class CMDIBase;
- //class CMDIChild;
class CMDIClient : public CWindow {
--- 478,483 ----
};
! // forward declaration.
class CMDIBase;
class CMDIClient : public CWindow {
|