|
I want register a context menu for image,document, music files as "Add to MyAppliaction " Means the files will be added to the drive from where the my appliaction runs......
Any suggestion how to do it?
|
|
|
|
|
hi...
i want to copy directory along with subdirectory recursively
using windows SDK
|
|
|
|
|
Do you need to SHFileOperation
|
|
|
|
|
|
hi...
i want to create vertical toolbar like toolbar present in MS Paint
which has two columns.
how i can change size of toolbar.
i want to create toolbar using windows SDK programming.
|
|
|
|
|
You can see a lot of examples of Toolbars on codeproject
|
|
|
|
|
The CCS_LEFT (or CCS_RIGHT) styles will make it vertical on the left or right edge.
The TBSTYLE_WRAPABLE style will allow multiple rows of buttons.
ToolBar controls are windows so you can move/resize them with MoveWindow(), etc.
THere are messages to get button sizes so you can ccalculate the dimensions required to get
two rows of buttons. It's all here in the SDK...
Toolbar Controls Overview[^]
|
|
|
|
|
|
If unicode is defined LPTSTR is a wchar_t*, otherwise it's a char*.
|
|
|
|
|
|
Lord Kixdemp wrote: Windows Calculator told me I will die at 28.
you are using wrong tool for wrong purpose.
-Prakash
|
|
|
|
|
Mr.Prakash wrote: you are using wrong tool for wrong purpose.
I sure am!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Hi...I have a dialog box with a tree control that has check-boxes in it. What I need to do is, when any of the check-boxes in the tree control is checked, I need to do some processing, and for now let's just say, I need to put up a messagebox. I added a function for the 'NM_CLICK' message to intercept the left button clicks in the tree control, then I do a 'GetCheck' to see if the button is checked.
When I check the box, the 'GetCheck' function returns a 0 but a checkmark appers in the box. When I uncheck the box, the 'GetCheck' function returns a 1, and the checkmark is removed from the box. So this isn't really helping me figure out when the box is checked and not.
Any help would be greatly appericated.
Here is my code for the 'NM_CLICK'
void CDirectoryCheckDlg::OnClickTree1(NMHDR* pNMHDR, LRESULT* pResult)
{
CPoint pt;
GetCursorPos(&pt);
m_testTree.ScreenToClient(&pt);
UINT uFlags;
HTREEITEM ht = m_testTree.HitTest(pt, &uFlags);
if(ht != NULL)
{
// There is an item under the cursor.
m_testTree.SelectItem(ht);
// See what exactly was under the cursor:
switch(uFlags)
{
case TVHT_ONITEMSTATEICON:
{
// It is the icon (checkbox)
BOOL chkbox = m_testTree.GetCheck(ht);
if(chkbox)
MessageBox("Button is checked");
//CString str;
//str.Format("%d",chkbox);
//MessageBox(str,NULL,NULL);
break;
}
case TVHT_ONITEMBUTTON:
// It is the button
break;
}
}
*pResult = 0;
}
|
|
|
|
|
When the control issues the NM_CLICK notification, it hasn't changed the state of the checkbox yet.
You might try looking at the TVN_ITEMCHANGED [^] notification. Also look at the general tree control article here[^], especially the section entitled Working with state image indexes.
Software Zen: delete this;
|
|
|
|
|
This code works fine, but as I learn more about VC++ I wonder if it is OK. I think index exists only within the function, but I'm not sure if it can be returned to targetPrice without problem. There has been no problem so far, but my program isn't finished yet. (basePrice is global.)
int q = GetIndexForPrice(targetPrice );
...
...
...
int CTradingdemoDlg::GetIndexForPrice(double price)
{
int index;
index = (price - basePrice)/ .0025;
return index;
}
Thanks
|
|
|
|
|
Oliver123 wrote: I think index exists only within the function
Yes but int CTradingdemoDlg::GetIndexForPrice(double price)
and
return index;
is handled by the compiler by "copying" the value from the index variable inside the function into the value of the variable outside the function that receives it "int q".
led mike
|
|
|
|
|
hi guys
Could someone please help me to convert from dword to lpcvoid?
This is my code:
LPCVOID voider;
DWORD copytothis;
lpBaseAddress = FakeBF2Start;
but i get an error when i try that:
error C2440: '=' : cannot convert from 'DWORD' to 'LPCVOID'
(that code is not the entire code just so u no its just pseudo but thats the only part that is causing probs)
Thanks in advance
|
|
|
|
|
Cyclone02 wrote: lpBaseAddress = FakeBF2Start;
Perhaps:
lpBaseAddress = (LPCVOID) &FakeBF2Start;
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thanks a lot but when i use that code with this :
lpBaseAddress = (lpBaseAddress - (LPCVOID)&RealStart) + (LPCVOID)&FakeStart;
then it does not work it displays this error:
: error C2036: 'LPCVOID' : unknown size
: error C2036: 'LPCVOID' : unknown size
do u no how to fix this?
Thanks
-- modified at 14:33 Saturday 28th October, 2006
|
|
|
|
|
You're trying to do pointer arithmetic on void pointers. The compiler doesn't know the size
of void so it can't add the pointers. You need to use an appropriate pointer type (LPBYTE,
LPWORD, etc.) for the arithmetic then cast the result to a LPCVOID.
Without knowing what types lpBaseAddress, RealStart, and FakeStart are I can't show you example
code
Mark
|
|
|
|
|
LPCVOID lpBaseAddress
DWORD RealStart
DWORD FakeStart
can u please show me an example code as that would be very helpful.
Thanks
|
|
|
|
|
Ok it looks like you're adding/subtracting the VALUE of RealStart/FakeStart, not the address,
right?
lpBaseAddress = (LPCVOID)(((BYTE*)lpBaseAddress - RealStart) + FakeStart);
Subtracting the ADDRESS of RealStart then adding the ADDRESS of FakeStart doesn't make sense
to me so I assume that's what you're doing.
Is that what you had in mind?
Mark
|
|
|
|
|
thanks a lot m8 that worked
|
|
|
|
|
Hello everyone!
I was just wondering this... I have a variable that I want to write to a file that can have only 4 values, so only 2 bits needed... If I can't write plain 2 bits to a file, what's the most "efficient" thing I can use? char ?
Thanks! (and sorry if I'm being teh big n00b... )
Windows Calculator told me I will die at 28.
|
|
|
|
|
A single byte is the smallest size you can write to disk.
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
|
|
|
|