|
Ahh, OK that makes sense. Do you remember/know how to do this?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
CreateFont takes a charset as one of its parameters. It can be ANSI_CHARSET, RUSSIAN_CHARSET, etc.
The trick, of course, is to make sure you have fonts supporting that character set. You can do this with EnumFontFamiliesEx .
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
OK I found it! Doh!
It's the fdwCharSet in CreateFont() or lfCharSet in LOGFONT. I've always wondered what the hell that was for
Would it make sense that I check the current locale, and based on this try and guess the right char set to use (falling back on a some sensible default like DEFAULT_CHARSET)?
some thing like:
LOGFONT lf;
if ( locale == polish || locale == russian etc... )
{
lf.lfCharSet = EASTEUROPE_CHARSET;
}
else if ( locale == arabic || locale == etc )
{
lf.lfCharSet = ARABIC_CHARSET;
}
and so on
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Yeah, that's more or less how I do it.
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
Hi. I have problem with simulating pessing ctrl+c. I'm subclassing an listview control and I want "press" ctrl +c. This is not a problem of focus because I tryed this in such a way:
<br />
HOOKS32_API LRESULT CALLBACK MessageListProc(HWND hwnd, UINT uiMsg,<br />
WPARAM wParam, LPARAM lParam)<br />
{<br />
switch (uiMsg)<br />
{<br />
case WM_KEYDOWN:<br />
{<br />
int key=(int)wParam;<br />
if(key=='D' || key=='d')<br />
{<br />
PostMessage(hwnd,WM_KEYDOWN,(WPARAM)VK_CONTROL,(LPARAM)0x0001D001);<br />
PostMessage(hwnd,WM_KEYDOWN,(WPARAM)'C',(LPARAM)0x002E001);<br />
<br />
PostMessage(hwnd,WM_KEYUP,(WPARAM)VK_CONTROL,(LPARAM)0xC001D001);<br />
PostMessage(hwnd,WM_KEYUP,(WPARAM)'C',(LPARAM)0xC02E001); <br />
<br />
return 0;<br />
}<br />
}<br />
}<br />
<br />
return CallWindowProc(gfnMessageListProc, hwnd, uiMsg, wParam, lParam);<br />
}<br />
WPARAM values are the same as I found it using spy++. (0x00000000 and for UP 0xC0000000 not working too)
I want to copy in this way content of a listview item to clipboard. Probably this may fail because in control code to check if ctrl is still pressed GetKeyState(VK_CONTROL) function is used.
So this a question: Is my code in some sence wrong or is there any other way of simulating ctrl +c pressing
Pain is a weakness living the body
|
|
|
|
|
Use the SendInput API call
James
|
|
|
|
|
Hmm I did it here is a code
<br />
keybd_event( VK_CONTROL,<br />
0x45,<br />
KEYEVENTF_EXTENDEDKEY | 0,<br />
0 );<br />
keybd_event( 'C',<br />
0x45,<br />
0,<br />
0 );<br />
<br />
<br />
keybd_event( 'C',<br />
0x45,<br />
KEYEVENTF_KEYUP,<br />
0);<br />
<br />
keybd_event( VK_CONTROL,<br />
0x45,<br />
KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,<br />
0);<br />
Pain is a weakness living the body
|
|
|
|
|
Using the basic code below, I am tring to change the caption(title bar) of the Dialog at run time. It does not work for me........my environment is net 7.1,MFC.
Any ideas on how to solve my problem?
void SystemAlign::OnBnClickedOk()
{
CPropertySheet mySheet;
mySheet.SetTitle(_T("Junk One"), 0);
mySheet.DoModal();
}
|
|
|
|
|
|
Is SetText() a method of CPropertySheet ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
SetText is not available in my environment which is net 7.1, MFC
|
|
|
|
|
SetWindowText() is a class member of CWnd and so will work for any window, including dialogs & propertysheets.
|
|
|
|
|
|
Do you mean it wont compile or nothing happens when the code executes?
Can you show your code fragment.
SetWindowText() is the correct method to use, there must be something else wrong.
|
|
|
|
|
It gives me an Unhandled exception....see code below and remember that my environment is net 7.1, MFC.
void SystemAlign::OnBnClickedOk()
{
GetDlgItem(IDD_SYSTEM_ALIGN)->SetWindowText("Junk One");
//CPropertySheet mySheet;
//mySheet.SetTitle("System: Signal-To-Noise", 0);
//mySheet.DoModal();
}
|
|
|
|
|
C++NewBe wrote:
GetDlgItem(IDD_SYSTEM_ALIGN)->SetWindowText("Junk One");
Going this route, you'd need to call SetWindowText() in the sheet's OnInitDialog() method.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I get the same Unhandle exception by placing it in OnInitDialog(). I think it is a different method call in net 7.1......I am wasting so much time digging for such a simple problem.....
|
|
|
|
|
C++NewBe wrote:
I get the same Unhandle exception by placing it in OnInitDialog().
But how are you calling the SetWindowText() in there?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I'm calling it like this
GetDlgItem(IDD_SYSTEM_ALIGN)->SetWindowText("Junk One");
|
|
|
|
|
Which is incorrect. Remove the call to GetDlgItem() .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
David,
It works on both ends, referencing the GetDlgItem was my problem.
Thanks a lot....
|
|
|
|
|
C++NewBe wrote:
It works on both ends...
Both ends of what?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
This works fine in v6. It must be something specific to v7.x, or you have other code in place that is masking the problem.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
SetWindowText(...) will work i suppose.
God is Real, unless declared Integer.
|
|
|
|