|
You can try to register your class.
|
|
|
|
|
On Mac OS there is a command called "CreateWindowGroup" which allows you to group two or more windows together. These windows move, minimize and maximize as a single unit. I am looking for something similar for Windows. I am coding in C++
Does Windows have something like this built in or would I need to roll my own?
modified on Thursday, October 29, 2009 3:25 PM
|
|
|
|
|
shaosean wrote: ...would I need to roll my own?
Yes. See the example here. Basically it just enables/disables all controls that are contained within the group.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Not a group of controls, but a group of windows.. Open two NotePad windows up, move one of them and pretend the other one was moving too 
|
|
|
|
|
shaosean wrote: Not a group of controls, but a group of windows..
In Windows, everything is a window. You are referring to an application window rather than a control window.
shaosean wrote: Open two NotePad windows up, move one of them and pretend the other one was moving too
I've never seen such behavior.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
(I just started programming for Windows today so some of the lingo is a little different from one OS to the next)
Yes, an application window.. If everything is a window, would the same concept of grouping control windows work with application windows? Something for me to test out when I get back home..
|
|
|
|
|
shaosean wrote: If everything is a window, would the same concept of grouping control windows work with application windows?
Without digging into it deeper, I can't say for sure. If it is, I doubt it's 5-6 lines of code like that example I referenced.
Just out of curiosity, why would you want/need such behavior?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Two keep two windows linked together of course
The plugin I wrote on the Mac has this feature (part of the OS) and someone had requested this feature for Windows and seeing as I am starting the Windows version of the plugin I thought I would try to tackle it but it seems like I may need to wait for this feature..
|
|
|
|
|
shaosean wrote: Two keep two windows linked together of course
Admitingly, I've only been using Windows for 20 years, but in all that time, I've never had the need to link two separate windows together. Other peoples' mileage may vary, however.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
I have used Windows since 2.0, Mac since 6.0 and have not really seen much of a need for this feature either, but since I started writing little C++ plugins for the language I normally code in I get all kinds of requests, this being one of them (they liked the feature in the Mac plugin and asked if I could do the same on Windows)
Thanks for all the replies but it looks like this is not something standard in Windows.. Anyone willing to try to do this? I have a whole 20 CAD in PayPal I can part with (I am jobless and only program for fun and learning)
|
|
|
|
|
shaosean wrote: Open two NotePad windows up, move one of them and pretend the other one was moving too
Two notepad windows means two different processes. You need to do some IPC for this.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I think the OP wrote that as an example ...
This signature was proudly tested on animals.
|
|
|
|
|
Yes it was an example.. As previously mentioned I am coming from a Mac background where two document windows in an application is only one process..
|
|
|
|
|
AFAIK, nothing in Windows do that.
You need to code that yourself; it's not technically that hard, but specifications and requirements can make it a b*tch to implement.
This signature was proudly tested on animals.
|
|
|
|
|
HI all,
In property sheet and property pages,the by default font is fixed,iwant to set Font "Verdana(8)" to all pages and propety sheet also.
so i m taking help of this article.
http://support.microsoft.com/kb/142170[^]
all thinngs are done ,now i want to bold the caption of groupbox those are placed on property pages.
but its not done.
so please help me how can i do this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Le@rner wrote: now i want to bold the caption of groupbox those are placed on property pages.
See the Extras section of this article. It shows how to bold a static control. You can do the same thing for a button (i.e., group) control.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi,
how can i get handle to static control in combobox..
i tried
COMBOBOXINFO cbi;
cbi.cbSize = sizeof(COMBOBOXINFO);
m_ComboBox.GetComboBoxInfo(&cbi);
but cbi gives the handle for edit control but not static control....
Please help me regarding the same..
|
|
|
|
|
What static control do you mean?
A combobox doesn't have a static control.
Maybe you mean a label before the combobox?
|
|
|
|
|
Hi,
I'm creating a simple program wherein, the dialog contains only 2 elements, an edit box and a button(OK).
I've initiated a member variable for the edit box of the type 'int'.
After I run the application, enter a number and press OK, the number I've entered must be saved into the variable that I've already created.
After saving the number, the variable is used in a further part of the program, which is not relevant to this problem.
But the number is not being saved, resulting in halting the program.
Plzz help me in solving this problem.
Is my approach correct?
Thank You
|
|
|
|
|
Your approach does seem to be the correct one. I guess (as always) the devil's in the detail..
Don't know if you're using mfc or just plain c. Here's some code that works without mfc.
STEP 1: Create the main program window and the necessary controls.
#define IDC_EDIT 1001
HFONT hfont0 = CreateFont(-11, 0, 0, 0, 400, FALSE, FALSE, FALSE, 1, 400, 0, 0, 0, ("Ms Shell Dlg 2"));
hwnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_APPWINDOW, szClassName, "Dialog", WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP | WS_SYSMENU, 0, 0, 285, 78, 0, 0, hThisInstance, 0);
HWND hCtrl0_0 = CreateWindowEx(0, WC_BUTTON, ("OK"), WS_VISIBLE | WS_CHILD | WS_TABSTOP | 0x00000001, 234, 15, 35, 23, hwnd, (HMENU)IDOK, hThisInstance, 0);
HWND hCtrl0_1 = CreateWindowEx(0, WC_EDIT, 0, WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_BORDER | ES_AUTOHSCROLL, 162, 15, 66, 23, hwnd, (HMENU)IDC_EDIT, hThisInstance, 0);
HWND hCtrl0_2 = CreateWindowEx(0, WC_STATIC, ("Enter a +ive Int:"), WS_VISIBLE | WS_CHILD | WS_GROUP | SS_LEFT, 63, 24, 84, 13, hwnd, (HMENU)-1, hThisInstance, 0);
SendMessage(hCtrl0_0, WM_SETFONT, (WPARAM)hfont0, FALSE);
SendMessage(hCtrl0_1, WM_SETFONT, (WPARAM)hfont0, FALSE);
SendMessage(hCtrl0_2, WM_SETFONT, (WPARAM)hfont0, FALSE);
STEP 2: Handle the WM_COMMAND message in our message handling function
(and in this example, show the number entered as well as 2x the number entered)
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
tmp = GetDlgItemInt(hwnd, IDC_EDIT, &didSucceed, false);
sprintf(successStr, "%d\n2 * num = %d", tmp, tmp*2);
if (didSucceed)
MessageBox(NULL, successStr, "Number entered:", MB_OK);
else
MessageBox(NULL, "Invalid number!", "Error", MB_OK);
}
break;
modified on Thursday, October 29, 2009 10:37 PM
|
|
|
|
|
raviteja2020 wrote: But the number is not being saved...
How are you verifying this?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
If you're using MFC, then you can use the class wizard to add a variable to your dialog, and "attach" it with the edit window. When OK, is pressed, the number is grabbed and put into your variable.
Look at:
DoDataExchange<br />
UpdateData<br />
DDX_Text
on google or msdn for more information.
You've now had answers for raw Win32, and for MFC. If neither of those helps ata ll, then you either need a different forum, or to give more information.
Good luck,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi friends,
I have a requirement to show combobox (in addition to the column heading text) in four of the column headers in a list control. The intended functionality is that, when even user selects some value from the combobox, the content of the list control be filtered based on the user selection. Can somebody shed some light how to go about doing this.
Thanks
Sheebu
|
|
|
|
|
I'm 99% sure you can't do this. So, you have a few choices...
You could make a few comboboxes above the list control, and not use the header text?
Or you could detect that someone has clicked on the header control, and instead of sorting (default bahaviour), you could pop up a box instead?
For ideas on how to do that, have a look at my article: Generic Picker Dropdown Control[^] or the original inspiration for my article: Office 97 style Colour Picker control[^]
You won't be able to use them directly, but they will help you with the idea of positionaing a popup window next to another, in such a way as it looks like a combobox.
You have a thrid alternative of explaining to whoever is requiring this requirement that what they want is not easy, and are they sure they want to budget time / resources to this...
Good luck,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi Iain,
Thank you very much for your suggestions. I am trying to go with the second suggestion of yours. I will update this post with my findings..
Thanks
Sheebu
|
|
|
|
|