|
Ok, FWIW, this is the only alternative I got working:
INPUT shift_insert[4];
memset(ctrl_v, 0, sizeof(shift_insert));
shift_insert[0].type = INPUT_KEYBOARD;
shift_insert[0].ki.wVk = VK_SHIFT;
shift_insert[0].ki.dwFlags = KEYEVENTF_EXTENDEDKEY;
shift_insert[1].type = INPUT_KEYBOARD;
shift_insert[1].ki.wVk = VK_INSERT;
shift_insert[1].ki.dwFlags = KEYEVENTF_EXTENDEDKEY;
shift_insert[2].type = INPUT_KEYBOARD;
shift_insert[2].ki.wVk = VK_INSERT;
shift_insert[2].ki.dwFlags = KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY;
shift_insert[3].type = INPUT_KEYBOARD;
shift_insert[3].ki.wVk = VK_SHIFT;
shift_insert[3].ki.dwFlags = KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY;
SendInput(4, shift_insert, sizeof(shift_insert[0]));
ctrl-V didn't seem to work even with SendInput().
|
|
|
|
|
Uh, a typo: replace ctrl_v with shift_insert in the above snippet.
|
|
|
|
|
The problem is the following:
The text of inserted items do not appear if and only if i call DeleteAllItems() before inserting them. Something like this:
CTreeCtrl* pTreeCtrl = ( CTreeCtrl* ) GetDlgItem( IDC_TREE );
if ( !pTreeCtrl ) return;
if ( !pTreeCtrl->DeleteAllItems() ) return;
pTreeCtrl->InsertItem( "testing" );
pTreeCtrl->InsertItem( "testing1" );
If i remove the DeleteAllItems() function call everything works as it should.
Any tip ? Thanks
|
|
|
|
|
This is a known issue. There is a MS article about that.
The problem can be resolved by calling SetRedraw(TRUE).
Example:
DeleteAllItems();
SetRedraw(TRUE);
InsertItem(...);
The problem is that DeleteAllItems resets internal counter (number of items) to -1 instead of 0.
|
|
|
|
|
Problem solved! Thanks
|
|
|
|
|
I want to disable or enable all the controls on a form, but i don't want to use the classwizard to create control variables for each of them (since there are many controls). I've tried to disable the CFormView itself (EnableWindow), but that didn't work Does anybody have any ideas?
Thanks.
Er zit een korstje op mijn aars.
|
|
|
|
|
Its not the best way :
Knowing their IDs you can call
GetDlgItem( int nID )->EnableWindow (MODE) for each
or if your resource file is correctly numbered you can do a loop and disable them.
Hope it helps,
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Create a array of UINT that you want to enable or disable in group.
assign each element of the array the value of the item id
as a example
UINT uControls[10];
uControls[0] = IDC_STATIC;
uControls[0] = IDC_BUTTON1;
etc
then when you want to enable or disable;
for(int i =0;i<10;i++)
{
GetDlgItem(uContorols[i])->EnableWindow(TRUE or FALSE);
}
Hope this helpes.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
That's not exactly what i'm looking for since i have to no the ID of my controls, which means that any modifications made to the interface (i.e. new button or labels), will result in code changes and that's not what i want.
Er zit een korstje op mijn aars.
|
|
|
|
|
|
that looks like it might be it, i'll try it out right away...thanks!
Er zit een korstje op mijn aars.
|
|
|
|
|
that did the trick...thanks again!
Er zit een korstje op mijn aars.
|
|
|
|
|
You're welcome! Glad you're up and running!
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I have recorded the voice data to a wave file by the MS function such as mmioCreateChunk etc.I want to know if this file format is same to the format recored by the Windows's Recorder
|
|
|
|
|
It is
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
it is the same format, RIFF wave files
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
How can I get a line using the getline() function from a text file, and put that line to an element in a vector and keep doing this until end of file? Here is what I have so far...
char str[255];<br />
vector <int> vecInt;<br />
<br />
if(re == 0)<br />
{<br />
get_rand();<br />
cout << "empty\n";<br />
system("pause");<br />
}<br />
else<br />
{<br />
cout <<"has something in it\n";<br />
do<br />
{<br />
data.getline(str, 255);<br />
vecInt.push_back();<br />
<br />
} while(!data.eof());<br />
<br />
sort(vecInt.begin(), vecInt.end());<br />
<br />
}
If it helps I know that the only things that will be in that specific 'data' file would be numbers 1-9 and characters 'X''O''D' I would very greatly appreciate it.
|
|
|
|
|
What do you want to put in the vector? just the numbers? the characters? in what form? in a string form or "inteligent" form, like numbers are stored in int and chars in strings?
Anyway the logic is the same, but ill explain for strings how to do:
you create a vectorof string, you loop on the file and you push
the strings in your vector.
if you need to convert from char to int check atoi atof strtol family.
isdigit, isalpha isalnum family could help you to identify what data you have
Hope this helps,
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I need to put the whole getline into each into an element in the vector, how could I do this? When I do:
do<br />
{<br />
vecInt.push_back(data.getline(str, 255););<br />
} while(!data.eof());
I get an error.. please help me, I use
char str[255];<br />
vector <string> vecInt;
|
|
|
|
|
something like this:
typedef struct {
char[255];
} BUFF ;
vector vecInt (BUFF);
BUFF buffer;
do
{
data.getline(buffer.str, 255) ;
vecInt.push_back(buffer);
} while(!data.eof());
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi
Some time ago i send question here about BitBlt function in printing time.I had realized what its worked not correctly for my printer.And somebody suggest me to use StretchDIBits
function but same trouble arising,when i try to print a lot of text printer not worked(but when i print a little text all work fine)
This my code.
//Initialize printer DC m_prtDC
...
m_prtDC.StartDoc("Doc");
m_prtDC.StartPage();
StretchDIBits(m_prtDC.m_hDC,...);
m_prtDC.EndDoc();
m_prtDC.EndPage();
Where is my fault here???
And wheser exist a way to printed an Memory device context into printer.
Thank.
|
|
|
|
|
Although probably not solving your problem, it should probably be:
<br />
m_prtDC.StartDoc("Doc");<br />
m_prtDC.StartPage();<br />
StretchDIBits(m_prtDC.m_hDC,...);<br />
m_prtDC.EndPage();
m_prtDC.EndDoc();
"Time to give a Newtonian demonstration,
of a bullet, its mass and its acceleration."
-Stephen Hawking the gangsta rapper
|
|
|
|
|
How can i display Windows XP icons correctly(with alpha blending)? For pngs I use gdi+ but with .icos the alpha blending doesn't work...
|
|
|
|
|