|
Hello,can anyone help please(my second for today),
How can i open a file(for exemple d:\Temp\log.txt) through pushing a button in my MFC project?
Thank you all!
Johnny
|
|
|
|
|
Call ShellExecute with operation "open"
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
Thank you very much!!!
It works!
Johnny
|
|
|
|
|
Are you wanting to know how to:
1) respond to a button click
2) open the file using its associated application
3) open the file within your application
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thank you! but i already got help
thanks
Johnny
|
|
|
|
|
Hai all,
I am developing an application in VC++ MFC.
Then i have to migrate it to WinCE.(eVC++ 4)
In my application, I applied masking over the button controls on a dialog to load a bitmap of rounded rectangle shape.
If the buttons are transparent , the masking can be performed.
But there is no transparency option in WinCE.
How can a button be made transparent?
Please help me..
With thanks and regards
T. Arun Chakaravarthy
|
|
|
|
|
I am trying to program a notification popup that is similar to Outlooks message when you get a new email. What I am trying to accomplish is if the user is in another application and has our application minimized that a popup message appears on the screen notifying them of work that they have to perform. I would like this popup to appear regardless even if the all windows are minimized. I have tried variations of the following code
SetWindowPos(hwndOwner,HWND_TOPMOST,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_SHOWWINDOW);
SetForegroundWindow(hwndOwner);
SetFocus(hwndOwner);
stat = MessageBoxEx((HWND)Uxvt_vobj_get_attr(win, ATTR_NATIVE_WINDOW),u_str_ptr(mh), u_str_ptr(th), buttons | icon | defbutton | modalflag | miscflags,MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));
The best I have been able to come up with is a message that spans all windows which is a start but it only appears if I give focus to our application and then click on another application - I need it to do it regardless of focus - any ideas? Thanks Rider
|
|
|
|
|
Explain the reason you are passing in SWP_NOZORDER and SWP_NOMOVE? Given that the window is minized, how is SWP_NOZORDER going to affect focusing the window?
Kuphryn
|
|
|
|
|
Have you tried changing the modality of the message box, like:
MessageBox(..., MB_APPLMODAL);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am trying to find a way to send an interrupt to a process. I have put a GUI around a "console application" and redirected its output to the GUI. Now I need a way to send a CTRL-C to the "Console App".
Any help would be greatly appreciated.
Thanks
DCrawford999
|
|
|
|
|
|
It's a bitch!
Anyhow here is the thing I got myself a string, just a word.
I need to locate a char in it and then erase it, also it must be done in a loop so that if char is in there twice etc. it would be deleted.
Problem: What if char doesn't exist in the string.
I tried to use if( !(blahblah.find(char)) ) doesn't work because if .find
doesn't see the char it throws the value of char position out of range of length of string or drops it bellow zero, causes an out of range error.
(This took me half a day to figure out)
So I used: if( (blahblah.find(char) < 0) || (blahblah.find(char) => Length) )
same crap!
Two hours later found strpbrk()!
How can I use it together with strlen to simplify the condition and avoid
out of range error during run-time.
Basicaly what I need is to look at a string, single word. Check if it has a char I provide. If it doesn't I need the if-statment to fall thru.
But if it does have it I need to erase it, this I can do .
|
|
|
|
|
if (strchr (blahblah, char))
eraseit ;
Is this what you are looking for?
|
|
|
|
|
Thanks!!!
|
|
|
|
|
CreepingFeature wrote:
...I got myself a string...
Would that be an STL string or an MFC CString?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Interestign question for you all to mull over. I'm using a CListCtrl to display a large number of image icons, and I need to be able to force the number of icons (in LVS_ICON style) to be displayed to be 8 per row regardless of the control size, ie to have both vertical and horizontal scroll bars.
Anyone got any ideas?
Thanks in advance, John.
|
|
|
|
|
This is an untried wild guess, but could you use CListCtrl::SetItemPosition and locate them manually? You could also take a look at CListCtrl::ApproximateViewRect and the MSDN article "Implementing Working Areas in List Controls"
|
|
|
|
|
Hi,
I am developing a software .....for that I have to open matlab inside a view port. For this reason I am using the parent and child functions and window handles. But it works perfectly with program like winword, notepad , internet explorer .... but not for matlab ..... it is denying to be a child window .... and going outside ...... I have also used the class name of Matlab's main window to find the handle of it .... even then it goes outside ..... can any body help me with this problem .... I just wanna open matlab inside my view port and it will remain there without exchanging any data to the main program ........
Sangit
|
|
|
|
|
Hello,
I wish to have a combo box for which the window text is always the same. For example, the text of the combo box is "Select Widget". When the drop down button is clicked, a list of widgets should appear; after a widget is selected, the combo box should once again show the text "Select Widget", rather than displaying the selected widget.
I have tried simply using SetWindowText on the CComboBox object, but that did not work.
Might anyone have a bit of sample code doing this?
Thanks
|
|
|
|
|
[Shameless plug]
You might want to consider using a FooButton[^] whose caption is "Select Widget". When the button is clicked, display your widget selection menu as described in the section "Displaying a popup menu".
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I may recode it to do just that if I am unable to get the combo box to work.
Using the FooButton is slightly more complicated for me as the button would be on a toolbar and I would need to call Create() for it myself.
I appreciate the input.
|
|
|
|
|
The combo box sends a change event message whenever someone makes a selection. If you override this message, you can then (a). handle that selection, then... (b) reset the selection to the 'Select Widget' text.
Have a look at the various event messages sent from the class wizard to override.
I Dream of Absolute Zero
|
|
|
|
|
The problem is that I don't want a "Select Widget" selection to appear as a choice when the combo box drops down.
Thanks for your input.
|
|
|
|
|
I think I got all my thinking wrong with my current work.
I did want to overlay bits, ints and floats with an integer array, but having just checked that only the first item in the array is being used.
The test I uesed was
typedef struct<br />
{<br />
unsigned short x;<br />
unsigned short y;<br />
unsigned short z;<br />
}MyStruct;<br />
<br />
union <br />
{<br />
MyStruct data;<br />
unsigned short buffer[32];<br />
}overlay;
If I change x, y or z then only buffer[0] is affected and x, y, z all take the same value.
Does anyone have a suggestion as how to do this sort of thing;
e.g.
Have a structure such as:-
1 bit;
2 bits;
8 bits;
float;
int;
short;
unsigned short;
3 bits;
long;
and overlay it with an array such as unsigned short buffer[32];
So that you can use the buffer (to send the data) and the other items can be modified directly in the program (and changes reflected in the buffer).
Otherwsie a lot of code will need written.
Hlp!?!
|
|
|
|