|
What about two edit boxes, one for dollars and the other for cents? Or, what about adding the vertical line to the edit box?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I thought about that. Two edit boxes just complicates it. You type in a
number 1234 and then tab off to type in the cents. Its faster to just type
in the number as is.
I thought about adding a vertical line to the edit, but have not figured out
a nice, simple, clean way of doing that.
I found a program on the web that looks like it has the feature Im looking
for. Its just a simple edit box and you can see the form in the background
of that edit.
If you know how to draw that line in the edit box, that would be great.
|
|
|
|
|
|
Hi Experts,
I have a problem. I need to do several cleanup jobs , when the system log off. I tried it by using WM_QUERYENDSESSION on Activex Control class. But it is not working. Please help me.
Thanks,
Spk.
|
|
|
|
|
SAKruykov asked you to clarify your original post[^]. I suggest you do that there, instead of starting a new thread here.
|
|
|
|
|
hello Frndz,
I am using oracle database for my application... in which i wanted to check that database was corrupted or not before my application get started ... kindly give me idea about it..
thanks in advanced...
|
|
|
|
|
I am not sure what this has to do with C++; I suggest you move it to the Database forum.
The best things in life are not things.
|
|
|
|
|
Does Oracle expose an API that you can use for this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I wouldn't think that was generally possible.
It also depends on what "corrupted" means.
And for a small database I wouldn't think the cost (time to implement) wouldn't be worth it for the product and for a large database it would not only take a long time but I wonder what the app is going to do then?
|
|
|
|
|
According to MSDN, using SetProcessDefaultLayout(LAYOUT_RTL) should change the layout to right-to-left. However, it does not change the window caption - the buttons are still on the right.
I have found that using the extended style WS_EX_LAYOUTRTL does move the caption buttons to the left.
Is this how SetProcessDefaultLayout() is supposed to work? Or is there another API that will move the caption buttons to the left?
While WS_EX_LAYOUTRTL does work, it means that each window creation has to be intercepted and this flag added. I was hoping to find some way to do it only once, when an app starts.
Thanks for any suggestions.
|
|
|
|
|
Read this[^] and see if it works for you.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Thanks for that link, but as I said, SetProcessDefaultLayout() doesn't have the same effect as WS_EX_LAYOUTRTL , which Chen fails to mention.
|
|
|
|
|
I know,, i was referring to the other method, some special chars in the varsion string or something alike. Did you try that too?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Anyways, you could try hooking CreateWindow for your application OR register a windows hook for your process and catch the WM_CREATE message and try to add the WS_EX_LAYOUTRTL flag to created windows using ModifyStyleEx (don't know if it can be modified at runtime).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Hello everyone,
I've been experimenting with C++ and how to build a form with it (without MFC).
I've created two buttons at runtime with the following code:
(I used a bit of copying and pasting)
if (button1 == NULL)
{
button1 = ::CreateWindowEx(WS_EX_LEFT,L"button",L"Button1", WS_CHILD ,50,50,50,50,parent,NULL,::GetModuleHandle(NULL),NULL);
SendMessage(button1, WM_SETFONT, (WPARAM)defFont, MAKELPARAM(TRUE, 0));
::ShowWindow(button1,SW_SHOW);
}
if (button2 == NULL)
{
button2 = ::CreateWindowEx(WS_EX_LEFT,L"button",L"Button2", WS_CHILD ,125,50,50,50,parent,NULL,::GetModuleHandle(NULL),NULL);
SendMessage(button2, WM_SETFONT, (WPARAM)defFont, MAKELPARAM(TRUE, 0));
::ShowWindow(button2,SW_SHOW);
}
There's no problem with building the buttons, this is my WndProc:
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case SW_SHOW:
break;
case WM_COMMAND:
if (wParam == BN_CLICKED)
{
Triggered(L"1"); }
break;
case WM_SHOWWINDOW:
Init(hwnd); break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
How can I tell which one sent the message?
--
Nevermind, got it.
lParam equals with the (LPARAM)handle of the button that sent it.
modified on Tuesday, June 7, 2011 3:05 PM
|
|
|
|
|
When you call CreateWindowEx, the return is a handle to the button, that same handle can be used within the WPARAM or LPARAM to distinguish, or alternatively, if you have two button and you must distinguish, then they should probably be sending different messages.
|
|
|
|
|
Another way is to create button window with id.
button1 = ::CreateWindowEx(WS_EX_LEFT,L"button",L"Button1", WS_CHILD ,50,50,50,50,parent,(HMENU)100,::GetModuleHandle(NULL),NULL);
button2 = ::CreateWindowEx(WS_EX_LEFT,L"button",L"Button2", WS_CHILD ,125,50,50,50,parent,(HMENU)200,::GetModuleHandle(NULL),NULL);
Now you can distinguish which is which.
case WM_COMMAND:
if ((UINT)HIWORD(wParam) == BN_CLICKED)
{
switch (int)LOWORD(wParam):
{
case 100:
Triggered(L"1"); //Shows a messagebox.
break;
case 200:
Triggered(L"2"); //Shows a messagebox.
break;
}
}
break;
|
|
|
|
|
How can I get the title of this window and ensure it has certain specific text in it, to separate it from other notepad windows like it in C sharp? I have a program I'm trying to send controls to and the controls differ depending on the title and text of the window. I was using a DLL add on that will not function correctly in win7 because of the different way some GUI windows are drawn, so I wanted to make the entire app .net native.
Thanks for reading.
http://img683.imageshack.us/img683/3281/testgui1.jpg[^]
|
|
|
|
|
Post in C# forum... this is C/C++/MFC
|
|
|
|
|
My apologies, I clicked on the wrong link
|
|
|
|
|
I've done that in the past too, no worries... but you'll probably get better help over there... 
|
|
|
|
|
Hi All,
The Api LoadInstanceString(..) is Failed it is giving an Empty String in Windows7 Operating system.
code.
-----
CString strTemp;
::LoadInstanceString(IDS_MSG_NODBQLPLANS, strTemp);
AfxMessageBox(strTemp);
Help me out.
Thanks & Regards,
uday
|
|
|
|
|
I cannot find any reference to LoadInstanceString() in MSDN, is this a standard part of the Windows API?
The best things in life are not things.
|
|
|
|
|
Hi,
I am Sorry
::LoadString(HINSTANCE hInst,UINT uid,LPWSTR,int len) Api is been Failed.
Code
----
_TCHAR buffer[2048];
LoadString(h, nResId, buffer, 2048); ---> Here the Code is been Failed for Windows7 O.S.
strMsg.Format(_T("%s"),buffer);
help me out.
Thanks & Regards,
uday.
modified on Tuesday, June 7, 2011 6:48 AM
|
|
|
|
|
Hi,
try to call GetLastError() and take a look to the error, can be usefull.
|
|
|
|
|