|
SendMessage(hwnd, WM_LBUTTONDOWN, (WPARAM)(fill this out, use your help),(LPARAM)(same here..));
Piece of cake.
|
|
|
|
|
You want to send a message? How about the apply named SendMessage function?
SendMessage(hWnd, WM_LBUTTONDOWN, 0, 0 ), Doh!
|
|
|
|
|
|
I think it's the only way so try again
|
|
|
|
|
Since you didn't get this answered, what seems to be the problem??
Is the hWnd parameter the button you are trying to invoke? Perhaps you could post the problem code so it can be ignored.
|
|
|
|
|
|
One possible way is using API mouse_event
::mouse_event ( MOUSEEVENTF_LEFTDOWN , mouseX , mouseY , NULL , NULL )
look in MSDN for full description of MouseX , MouseY .
|
|
|
|
|
I have a template which should take any type of input such as int, float, or string and return a value.
template<typename T> void GetParmValue(T& value)
{
std::string& str = GetSomeString();
std::istringstream iss(str);
iss >> value;
}
If value is of type std::string then istringstream only gives me the first part of the string. It's spliting the string at the white space.
For instance:
std::string value;
std::istringstream iss("Test 123");
iss >> value;
value is now "Test" and not "Test 123".
Any ideas on how to get around this?
|
|
|
|
|
You'll have to use the getline() function to get the compleate string.
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
You have to specialize your template like this:
template<> GetParmValue(std::string& value)
{
std::string& str = GetSomeString();
value=str;
}
Let us know if that fixed your problem
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Can someone show/teach me the script for imitating keyboard input. I want to make a loop that simulates someone inputing Alt+"C", [five second pause], "pepper", [five second pause], Tab, [five second pause], "mint", [five second pause], Enter, [five second pause], Alt+A. Someone plz help me?!?!?!?!
|
|
|
|
|
Use the SetTimer function to time the messages; use the OnChar message to send character messages.
It would be something like this:
CView::MyFunction()
{
SetTimer(ID_TIMER1, 5000, NULL); //You can use a callback function if you like
SetTime(..);//etc.
}
CView::OnTimer() //classwizard generated.. you wouldn't use this function if you use a callback function.
{
if (blabla..)
{
blabla..
}
}
CView::Onchar(blabla etc..) //classwizard generated function
{
swith (nChar)
case ??: //change this
{
//and this..
}
case ??:
{
etc..
}
}
|
|
|
|
|
I have only taken a year long course using C/C++ so I am a newbie. I was using the metrowerks compiler but I just got Visual C++. If it is not too much trouble. It would be very helpful if you could write out all the code. That would be the greatest. Thanx.
|
|
|
|
|
Hey Folks,
With all this talk of privacy and various registration schemes which are required with WinXP, do you think when you compile an application it stores anything about your PC (Mac Address, Disk Serial) in the actual EXE?
I read somewhere, and proved it with a hex editor, that a document created by word actually contains the MAC address of your network card.
Any comments?
Do you think MS stores the VC serial number in the exe?
Anyone have any code?
Mike.
|
|
|
|
|
Thats a good question for "The Lounge" I bet you'd get a lot more responses too.
|
|
|
|
|
that a document created by word actually contains the MAC address of your network card.
If there are any GUIDs in the document, then the last 6 bytes of the GUID will be your MAC address, since that's how MS makes GUIDs. MS provided a patch for Word that removed the addresses. (Note that starting with Win2K, UuidCreate() [and thus CoCreateGuid()] no longer puts the MAC address in GUIDs.)
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
Hi again... (getting tired of all my posts? Please don't be...
Is there a way to define when the mouse pointer actually can drag the splitter bar... I have a pretty narrow bar but still I would want the cursor to become "splitter drag" at the very ends of the splitter bar. Any suggestions?
/Tommy
|
|
|
|
|
Hi all,
Is it possible to have CButtons in a CView? And I dont wanna use the dialog editor, i want to create them dynamically. How to I make the m_btn appear in my CView client area? Probably through the use of m_btn.ShowWindow(SW_SHOW) but from where should I call it?
Thx,
/Tommy
|
|
|
|
|
In OnInitialUpdate.
RECT rc = { 10, 10, 100, 100 };
m_Button.Create("Caption", WS_VISIBLE | WS_CHILD, rc, this, 1);
m_Button.ShowWindow(SW_SHOW);
The 1 is the ID, I suggest creating an ID range in resource.h and using it for dynamically created buttons, then use OnCommand to capture their being pressed. Michael Dunn gave some good advice on how this works in the thread on WTL dynamic buttons I started.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
Hi again all of you,
Does anyone know of some code that has been written to switch splitter layouts? Is this even possible to do? Because I want the initial views to be destroyed; I want to use them in the new layout.
What I mean is that if for instance you have a frame layed out with splitters in a 2x2 way, I want to be able to click a button to switch to a 3x1 layout (that is a 2 column splitter where the first column has a nested 3 row splitter)?
Thx,
/Tommy
|
|
|
|
|
You can use the DeleteColumn(), DeleteView() and DeleteRow() to remove them. See MSDN.
|
|
|
|
|
I tried to do something similar and wasn't sure if it was possible. My workaround was to make the first column in the splitter another CFrameWnd and then split that one to two rows.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Hi all MFC pro's,
Have you ever nested a splitter inside another static splitter? Of course you have.
I've noticed a bug in CSplitterWnd here. Say we have a 2 column splitter where the left column encapsulates a 2 row splitter. Got it?
Ok, so whenever I click the vertical splitter bar without actually moving it, the bar moves approx. 2 pixels to the right...!??!!?!?!? Anyone knows how to get rid of this pretty annoying behaviour? It would mean a great lot to me!
Thx,
/Tommy
|
|
|
|
|
Just move the damn thing using SetColumnInfo..
|
|
|
|
|
How do you mean...? After I release the mouse button, call setcolumninfo with 2 pixels in the opposite direction... that's ugly!
|
|
|
|