|
Have you taken a look at this article?
http://www.codeproject.com/gdi/customcaption.asp[^]
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
I'm trying to programmatically "click" a tab on a CTabCtrl.
My understanding is that I can use SendMessage to do that by using TCN_SELCHANGE. But I am also assuming that I need *something* in the lParam and/or wParam values. It seems to me that the index of the tab "clicked" has to be included in there somewhere and somehow. My question is how (or where)?
And where do I find things like this?
For example, I happened to find here at CodeProject some info on sending a MOUSEMOVE message to a window with the coordinates of the mouse position:
SendMessage(hWndTarget, WM_MOUSEMOVE, fFlags, MAKELPARAM(x,y));
Where do I find things like the fact that the lParam is for flags and the wParam is for the coordinates?
Any info is greatly appreciated. Thanks.
|
|
|
|
|
If you're using MFC, most of the classes abstract away the idea of having to send messages. Check out the documentation for CTabCtrl::SetCurSel(int nItem)?
Or do you actually need to move the mouse?
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Sure, that selects the tab, but unfortunately it does NOT call the OnSelchange code. Therefore, simply calling SetCurSel won't activate the code that goes along with clicking on a tab. That's why I need to actually do a SendMessage -- to call the OnSelchange routine as though a tab was actually clicked.
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/tab/notifications/tcn_selchange.asp
MSDN is the answer to all your SendMessage-Questions
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Yeah, I've been there. Personally I find it decidedly NOT helpful.
TCN_SELCHANGE Notification
--------------------------------------------------------------------------------
Notifies a tab control's parent window that the currently selected tab has changed. This message is sent in the form of a WM_NOTIFY message.
Syntax
TCN_SELCHANGE
lpnmhdr = (LPNMHDR) lParam;
Parameters
lpnmhdr
Pointer to an NMHDR structure. The hwndFrom member is the handle to the tab control. The idFrom member is the child window identifier of the tab control. The code member is TCN_SELCHANGE.
Return Value
No return value.
Remarks
To determine the currently selected tab, use the TabCtrl_GetCurSel macro.
Notification Requirements
Minimum DLL Version None
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95
See Also
TCN_SELCHANGING
Then if I go to SendMessage itself, I get:
SendMessage Function
--------------------------------------------------------------------------------
The SendMessage function sends the specified message to a window or windows. It calls the window procedure for the specified window and does not return until the window procedure has processed the message.
To send a message and return immediately, use the SendMessageCallback or SendNotifyMessage function. To post a message to a thread's message queue and return immediately, use the PostMessage or PostThreadMessage function.
Syntax
LRESULT SendMessage( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
Parameters
hWnd
[in] Handle to the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows.
Msg
[in] Specifies the message to be sent.
wParam
[in] Specifies additional message-specific information.
lParam
[in] Specifies additional message-specific information.
Return Value
The return value specifies the result of the message processing; it depends on the message sent.
And that doesn't tell me anything about what I need in lParam or wParam,
nor does it tell me where I might go about finding such information.
*That's* actually the info I'm hoping to get my hands on -
and an actual code example would be swell.
|
|
|
|
|
Post a TCM_SETCURFOCUS message, assuming that your Tab control is NOT using TCM_BUTTONS style. This message's default handler causes TCM_SELCHANGING and TCM_SELCHANGE messages to be generated & sent to the tab control.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Fantastic! It works perfectly.
Thanks a bunch.
|
|
|
|
|
I am so lost right now. I don't understand why I am getting the hard things to work and not the easy things but I need help with one simple thing. I have made a MFC project in vc++ 6.0 I am figuring I need to edit either the view.cpp/.h or the doc.cpp/.h but one way or the other, I can't figure out how to get a cursor in the document so that text can be typed, let alone saved and edited. Please help.
LOSTTWARE.com
|
|
|
|
|
BTW it is MDI if that helps.
LOSTTWARE.com
|
|
|
|
|
Well, I hate to sound rude or blunt, but I think your first step would be to learn C/C++
Then, try hunting down the functions on MSDN or in your Platform SDK documentation. If you don't know what I'm talking about, go to http://msdn.microsoft.com/ and do a search for Platform SDK.
Ja ne
Jenyka
-
|
|
|
|
|
|
hi,
i have the following scenarios, and i would like to know the solution of the professional developers like you...
with the developing experience you have, what would u do in such scenario's??
would really love to know your thoughts..
scanario1
Situation with customer
You have been briefed what is Automated Call Distribution System and how it integrates to a PBX through MS TAPI for Call Control and Reporting functions.
You have been briefed on the customer's purchase items and call flow.
Your job is to configure according to the call flow, test and train the users.
When you are showing the customer the call flow, the customer start having other ideas and place more requests. They insist it is part of the call flow because the call flow discussed earlier was not detailed enough.
How will you handle the situation.
scenario2
Remote access through dynamic ip
We have a new product requirement that needs 2 PCs on ADSL or 56k dialup (Dynamic IP) to access each other's data and communicate.
Security is required to stop unauthorized access and hacking.
What is your recommended solution?
What is the cost (licensing, development time, etc), limitation and resources required for your solution?
scenario3
VoIP using special voice card
We have a new product requirement that needs to have a call coming into a proprietary voice card connect to someone on the LAN whose PC is running NetMeeting.
The proprietary voice card has C sample codes to show you how to connect 2 person through 2 proprietary voice cards but not 1 card and 1 Netmeeting.
How will you approach the project?
What is the cost (licensing, development time, etc), limitation and resources required for your solution?
scaenario4
VoIP using modem
We have a new product requirement that needs to have a call coming into a voice modem connect to someone on the LAN whose PC is running NetMeeting.
What is your recommended solution?
What is the cost (licensing, development time, etc), limitation and resources required for your solution?
tks al ot for any comments...
really appreciate it...
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
Joseph R. Thomas wrote:
Situation with customer
You have been briefed what is Automated Call Distribution System and how it integrates to a PBX through MS TAPI for Call Control and Reporting functions.
You have been briefed on the customer's purchase items and call flow.
Your job is to configure according to the call flow, test and train the users.
When you are showing the customer the call flow, the customer start having other ideas and place more requests. They insist it is part of the call flow because the call flow discussed earlier was not detailed enough.
How will you handle the situation.
Been there, done that
A lot depends on your contract with the customer. You should ensure that they have signed off on the call flow before you begin installation. It sounds like your business analyst has screwed up if you are in this situation. The best advice is to create a balance between what you the customer wants and what they have paid for. If you want repeat business from the client then it is a good idea to be a little flexible, especially when it comes to ACD installations. A customer may not always know what they want until they see/hear the system in operation. You have to weigh up the costs of the changes against future business. It's something that only comes with experience and not something you can learn whilst doing your homework.
Michael
'Logic, my dear Zoe, merely enables one to be wrong with authority.' - The Doctor: The Wheel in Space
|
|
|
|
|
is it possible to create a simple application and delete it while it is running?
ie:
run c:\mySimpleApp.exe
(the app. copies itself-mySimpleApp.exe to memory space with CMemFile ???)
delete c:\mySimpleApp.exe but process is still running
obviously the challenge is to overcome "the application is currently in use" dialog.
any ideas?
|
|
|
|
|
You cannot delete a file while it is being executed (access denied).
BTW CMemFile is just like CFile but it writes to and reads from memory instead of hard disk.
If you mean the Task manager by "the Application currently in use" then this is impossible, you cannot hide runnig processes from it.
Bunburry
|
|
|
|
|
Hello,
I am trying to add video capturing to my application using a USB webcam. My application is an MFC application. I am trying to use the 'capCreateCaptureWindow' function as I found stuff about this on the msdn library. However, I am fairly new to Visual C++ and MFC applications so I was wondering if anyone could possibly talk me through the process? There's lots of stuff about this on the msdn library but I'm getting confused.
I know I should somehow create a capture window of the AVICap window class and connect it to a video driver and then the capture window should be ready to capture data. But how do I do this in practice?
If anyone has time, could they please talk me through each step of this process?
Alternatively, if anyone knows any good tutorials on how to capture video, could you please send me a link?
Thank you for your time.
|
|
|
|
|
Make sure that your webcam supports video for windows.
From personal experience VFW can be a pain to develop with and isn't really supported as much anymore (although I'm willing to stand corrected on that point). Although it takes a while to learn, DirectShow is certainly worth the effort. If you go to DirectShow you have the benefit of the sample applications distributed with the DXSDK to help you get started. Some of which may require minimal effort of modify to suit your purpose.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Andrew,
do u still remember which sample in DXSDK is about capture screen or capture window? i can't find it.
thx.
includeh10
|
|
|
|
|
Look at the AMCap (?I think) sample to see how to render to a user specified location. Alternatively you could write your own renderer filter.
If all you want to do is capture a frame Microsoft provide a grabber sample to grab a sample from a running filtergraph.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I am doing a project where I use functions in C to create letters on the output screen. I need a function which outputs a slope of letters down the screen(examples are below):
1)AAAA 3) XXX XXX
AAAA XXX XXX
AAAA XXX XXX
AAAA XXX
2) AAAA 4) XXX
AAAA XXX XXX
AAAA XXX XXX
AAAA XXX XXX
If anyone could help with a c function which would print any of these outputs, it would be appreciated. Thanks.
|
|
|
|
|
I need help about how to use OpenSSL library.
Is there any sample on the Web I can use ?
|
|
|
|
|
What is it you are trying to do?
|
|
|
|
|
I want to write simple https client..
Is there any good tutorial you can point me to?
|
|
|
|
|
I was astounded when I saw how you program with longhorn, it was easy fast, flexible, AND VERY POWERFUL The user interface was really good looking and VERY EASY TO MANIPULATE. WinFx is very good since .net developers wont have to learn alot of additional stuff. Everything in winfx is CUSTOMIZABLE. As being a c++ programmer, I have seen the future , I will program in visual c++ 6 until probably after the year 2003 (next year) on the .net framework to get a little started. If anyone wants to see the light, go see 2 below movies,
http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20031028LHORNDB/manifest.xml[^]http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20031107WINFXBA/manifest.xml[^]
The first one is about an hour long, though worth it, and the second one talks Very breifly about WinFX, about 10 minutes.
<marquee>Universal Project... Soon to be a .net
|
|
|
|