Click here to Skip to main content
15,896,063 members

Comments by qiuchengw (Top 3 by date)

qiuchengw 9-Dec-10 23:09pm View    
Deleted
Well, I tried ShowWindow with SW_RESTORE on another two project ,for Dialog Based application it works ok, But it still didn't work for the document/view application.
I will look for the reason later.
qiuchengw 2-Dec-10 21:34pm View    
Deleted
I have wrote these two help class:

class CAnsi
{
public:
CAnsi(const wchar_t *str)
{
int nW = wcslen(str);
int nC = nW * 2 + 2;
pAnsi = new char[nC];
int n = WideCharToMultiByte(CP_ACP,0,str,nW,pAnsi,nC,NULL,NULL);
*(pAnsi + n) = 0;
bfree = true;
}
CAnsi(const char*str) { pAnsi = const_cast<char*>(str); bfree = false;}
~CAnsi() {if (bfree) delete []pAnsi;}
operator char*(){ return pAnsi; }
char *pAnsi;
private:
bool bfree;
};

class CUnicode
{
public:
CUnicode(const char *str)
{
int nC = strlen(str);
int nW = nC * 2;
pUnicode = new wchar_t[nW];
int n = MultiByteToWideChar(CP_UTF8,0,str,nC,pUnicode,nW);
*(pUnicode + n) = 0;
bfree = true;
}
CUnicode(const wchar_t* str) { pUnicode = const_cast<wchar_t*>(str); bfree = false;}
~CUnicode() { if (bfree) delete []pUnicode; }
operator wchar_t*() { return pUnicode; }
wchar_t *pUnicode;
private:
bool bfree;
};
qiuchengw 2-Dec-10 21:29pm View    
Deleted
Thanks for sharing, very helpful.
but, if the window is minimized, how can you restore and bring it to top?
I have test these messages : WM_ACTIVE/WM_ACTIVEAPP/WM_SYSCOMMAND-SC_RESTORE..
none of them did work! why? please help.
thanks again for your work