|
You should be able find LVM_SETCOLUMNWIDTH in the
ClassWizard.
Open the Class Wizard and (in the Message Maps tab) look at the list box labeled "Object IDs:". By default the class name of the dialog will be selected. Search further down the list until you find the resource ID of your ListView control then select it. The "Messages:" list box to the right will then show the messages appropriate for ListView controls. Search through the list to find the one you want.
Good luck.
|
|
|
|
|
I must appologize. I went through the steps that I previously gave you and didn't find LVM_SETCOLUMNWIDTH.
After further thought I feel that you will have to subclass the ListView control (CListCtrl) with your own class that inherits from CListCtrl. Override the WindowProc function. (You'll find WindowProc in class CWnd.) The prototype should look as follows: (I hope all this formatting doesn't get lost. I'll double space to be certain.)
LRESULT CYourClass::WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
And the body should appear somewhat as follows: (I have not actually done this with CListCtrl but it should work.)
// Begin Body
{
int nFixedWidth = 100; // Hard-coded width
switch ( message ) {
case LVM_SETCOLUMNWIDTH:
// override lParam
lParam = MAKELPARAM( nFixedWidth, 0);
break;
}
return CListCtrl::WindowProc(message, wParam, lParam);
}
// End body
The value assigned to nFixedWidth is in list view coordinates.
It looks fairly simple. I hope this works for you
|
|
|
|
|
Hi
I think you should use the HDN_* notification messages,
together with HD_HITTESTINFO and may be WM_MOUSEMOVE and then if conditions are fullfilled just not route these messages any further.
Kurt
|
|
|
|
|
Hello ,
I am new to Internet Programming in VC++.
Can anyone of you out there inform me about how i can generate a form post that a browser generates when send the form post to the webserver.
Thanks in advance.
Regards
|
|
|
|
|
Hi,
Using Windows Sockets you are connecting to the HTTP server and then you send/receive data in the HTTP protocol. You can find all information you need in RFC 1945 "Hypertext Transfer Protocol -- HTTP/1.0" at http://www.rfc-editor.org/rfc/rfc1945.txt.
I you are not experienced in RFC reading/implementing check our Ultimate TCP/IP 3.0 product at www.dundas.com. This product can help you a lot.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hi Alex,
to add to your answer.
I have noticed a common mistake most people fall in
they forget to target the correct url
for example if they have an in box called Lastname in an asp page called page1.asp
they would send their post Request as follow
using telnet connect to www.anyserver.com port 80
then they would send the following ascii lines
// SNIPP
POST /page1.as HTTP/1.1
Content-Length: 17
[empty_line]
lastname=Alfadhly
[empty_line]
// SNIPP
although these steps are correct since it includes the three most importent pieces of the post i.e
1) POST command and the target url plus the protocol version
2) The conent length header of the data in the request
3) the data it self e.g lastname=Alfadhly
[NOTE:] I have ommited other headers such as referer and Host, and Cookies ] if they are used in the aps page
Most programmers tend to forget to look at the source of the asp page and forget thaat the target should be the one identified by the ACTION parameter of the post
I hope this might help
|
|
|
|
|
Hi Alex,
to add to your answer.
I have noticed a common mistake most people fall in
they forget to target the correct url
for example if they have an in box called Lastname and a submit button named Send in an asp page called page1.asp
they would send their post Request as follow
using telnet connect to www.anyserver.com port 80
then they would send the following ascii lines
// SNIPP
POST /page1.as HTTP/1.1
Content-Length: 28
[empty_line]
lastname=Alfadhly&Send=Submit
[empty_line]
// SNIPP
although these steps are correct since it includes the three most importent pieces of the post i.e
1) POST command and the target url plus the protocol version
2) The conent length header of the data in the request
3) the data it self e.g lastname=Alfadhly
[NOTE:] I have ommited other headers such as referer and Host, and Cookies ] if they are used in the aps page
Most programmers tend to forget to look at the source of the asp page and forget thaat the target should be the one identified by the ACTION parameter of the post
I hope this might help
|
|
|
|
|
Hi Alex,
to add to your answer.
I have noticed a common mistake most people fall in
they forget to target the correct url
for example if they have an in box called Lastname and a submit button named Send in an asp page called page1.asp
they would send their post Request as follow
using telnet connect to www.anyserver.com port 80
then they would send the following ascii lines
// SNIPP
POST /page1.asp HTTP/1.1
Content-Length: 28
[empty_line]
lastname=Alfadhly&Send=Submit
[empty_line]
// SNIPP
although these steps are correct since it includes the three most importent pieces of the post i.e
1) POST command and the target url plus the protocol version
2) The conent length header of the data in the request
3) the data it self e.g lastname=Alfadhly
[NOTE:] I have ommited other headers such as referer and Host, and Cookies ] if they are used in the aps page
Most programmers tend to forget to look at the source of the asp page and forget thaat the target should be the one identified by the ACTION parameter of the post
I hope this might help
|
|
|
|
|
Can I simulate the process of moving a mouse to an edit control and click the mouse button,
type in some words or password, and click an OK button (or press enter)?
Thanks
|
|
|
|
|
Take a look at the SendInput Win32 API function. There also are commercial tools you can buy for automated testing that will do this too.
|
|
|
|
|
Hi,
in my dialog the users want to change focus not by using the tab-key, instead they want
to jump directly to the different controls using accelerators.
Therefor i want to check the key combination in the PreTranslateMessage method, to set the focus.
How can i check this, because i always get only one key in the pMsg->wParam variable
and not the combination.
Need some advise or another solution.
TIA, Chris
|
|
|
|
|
if (0 > GetKeyState(VK_MENU)) ALT Key down
if (0 > GetKeyState(VK_CONTROL)) CTRL Key down
and so on
Kurt
|
|
|
|
|
Chris, this is a built-in feature of dialogs and doesn't require any code on your part. Just create a static control and put it next to the edit box, e.g.:
P&rice: [edit box here]
The &r will show up on the screen as an underlined "r". Make sure the static is right before the edit box in the tab order, and then pressing Alt-R will move the focus to the edit box.
If you *really* have to support shortcut keys using Ctrl, not Alt, then you will have to do some code. But using Alt has been standard for years, so go with Alt.
|
|
|
|
|
How could one create a static bitmap control that is palette savvy? My controls look great at 16 and 24 bits but but in 8 bit mode they look disappointing.
Thanks
|
|
|
|
|
|
Sounds like fun to me. I've done plenty of bit blitting but I must profess an ignorance of DIB sections. How do they differ from Windows bitmaps?
|
|
|
|
|
DIBSections are similar to bitmaps in that you have a handle that you can work with (an HBITMAP in fact), but they are device independant. They offer the best of both worlds: device independance and ease of use. They are also extremely useful when working in CE, since CE doesn't support many of the DIB functions - but does support DIBSections.
|
|
|
|
|
Why whenever I create a modeless dialog, and show it using ShowWindow(SW_SHOW), do none of my dialog controls show up?
I have a very simple dialog with a static text label on it. I showwindow to show it. Sleep for a few seconds, and then showwindow to hide it. However, my static control never appears on the dialog.
Any ideas?
Thanks,
Frank
|
|
|
|
|
Hi,
Can someone give me a hint on how to Subclass the Back, Next and Finish buttons on a wizard propertysheet page ?, I want to add icons or bitmaps to these buttons to look better.
Thanks.
www.usro.net
|
|
|
|
|
You can use GetDlgItem on these buttons like any other control (IDOK, IDCANCEL, etc.). They can be subclassed in the WM_CREATE of the property sheet.
|
|
|
|
|
Thank you, I tried to subclass the buttons in the classical way, the application runs without problems, but the buttons does not get painted. I sublcassed with CButtonST found on this site.
www.usro.net
|
|
|
|
|
This may be a very easy one, but I am trying to return multiple files from a CFileDialog using the OFN_ALLOWMULTISELECT parameter. How do I return the filenames using GetStartPosition()and GetNextPathName()?
|
|
|
|
|
If pressing CTRL+ALT+DEL in Win9x a box appears, which displays all runing applications. You can select an application an click on 'Close Task'. Everybody knows that.
The Problem:
If I select, for example Windows Explorer, and click on 'close task' the Windows Explorer will be closed at once. If I select my application and click on 'close task' a dialog appears after 30 seconds or so, which tells me 'task is not responding, blah, blah 'end task' 'wait' '. (My application is not crashed!)
The Question:
Can anybody tell me what messages are send to an application from the 'close task'-box or which messages do I have to handle? Or is there another solution for this problem?
thanks for your help!
|
|
|
|
|
I would send WM_QUIT message to the main window of a running application if I wanted to close it. WM_CLOSE message might be a good choice as well. These are two messages that could be used to kill an application nicely. If application is still running then it is highly probable that some overkill solution like TerminateProcess() function is used.
Regards,
Andrei Zenkovitch
Dundas Software
|
|
|
|
|
Hi,
i have several modeless dialogs and i want know when the dialog gets the focus.
I haven't found any message which is send to the dialog before he gets the focus.
Any solution?
TIA, Chris
|
|
|
|