|
PS if you can't find the article I wrote code for C++ on the desktop (don't know how applicable it is to embedded) that does wrap the web browser:
Win32WebBrowserHost.h[^]
Maybe that will help a bit?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
hi,
we can display icons in system tray. but i want to display an icon as number in system tray. how can i create an number icon in a system tray or dynamically?
or any way to create an icon dynamically?
Regards,
Srinivas
|
|
|
|
|
|
enhzflep wrote: Here ya'are, this code'll do it.
There really are nuggets of gold here on this site, eh...
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Sure are mate. I'd hate to imagine what it would cost if I'd been required to pay for all that I've learned from this wonderful site.
You've certainly contributed to that which I know Iain.
Thanks All.
Simon.
The easiest way to make the world a better place is to refuse to help those that wreck it....
|
|
|
|
|
Hi all,
I have a folder and in that i have some files, i want to delete that folder with files and for doing so i am using RemoveDirectory api....
but it is not deleting my folder...
How can i do it????
Thanks in advance
|
|
|
|
|
Try this in CMD
rd /s FOLDER
i think it will work
Regards:
Xohaib Shirani
|
|
|
|
|
But i want to do it through coding...
|
|
|
|
|
While you can do what Shirani's suggests via code, it's definitely the wrong aproach.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
See Here[^]
Edit: Sorry, that was the CE-version.
See Here instead[^]
An interesting piece of information from that page is:
To recursively delete the files in a directory, use the SHFileOperation function.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
See SHFileOperation/rmdir or deletefile.
|
|
|
|
|
have you only checked the API Documentation[^] ?
"lpPathName : The path of the directory to be removed. This path must specify an empty directory, and the calling process must have delete access to the directory. "
down further the page, you can see this :
"To recursively delete the files in a directory, use the SHFileOperation[^] function."
next time, google before asking please
|
|
|
|
|
I like to Delete folder in any case even if other applications or other users are accessing the same folder. Forcefully i like to delete the Folder. I receive Error 32 when the function SHFileOperation(). Can any one tell me how can i acheive this.
|
|
|
|
|
hi
I need to write a program that needs to "steel" the data that appers on a control box of a diffrent program.
I saw how the SPY programs here are built but they all need a user interface to point to that control.
I want to go throgh all the process that are running and check if what i want is there and then get it's handle.
Visual studio spy++ does something like that. but how???
please help me i am trying to fins a solution for a long time.
Thank you
|
|
|
|
|
Do you want to make a program like SPY++?
|
|
|
|
|
i want i program that will tell me what is the value in the calculator(for example) text box. the UI shouls be output only.
the way i thought of doing this was to go through all the process and when i reach to right one check it's window handle's. but i don't how to get the process's list and how to get the handles from the process.
|
|
|
|
|
For start you can use EnumWindows for get handle for each process and for more functions that you will be help them see Process and Thread Functions[^].
|
|
|
|
|
YS8888 wrote: i want i program that will tell me what is the value in the calculator(for example) text box.
Or maybe a password text box??
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think its not possible for all programs. 
|
|
|
|
|
YS8888 wrote: I need to write a program that needs to "steel"
Since your intentions are so honest, I'm going to help you: have a look at EnumWindows [^] function.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Try something like this:
#include "stdafx.h"
#include <tchar.h>
#include <malloc.h>
#include <windows.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
HWND hwndCalc = FindWindow(_T("SciCalc"), _T("Calculator"));
if (hwndCalc == NULL)
{
cerr << "Couldn't find the Calculator window!" << endl;
return -1;
}
HWND hwndEdit = FindWindowEx(hwndCalc, NULL, _T("Edit"), NULL);
if (hwndEdit == NULL)
{
cerr << "Couldn't find the Calculator's edit control!" << endl;
return -2;
}
int len = SendMessage(hwndEdit, WM_GETTEXTLENGTH, 0, 0);
if (len == 0)
{
cerr << "Text empty?!?" << endl;
return -3;
}
LPTSTR pBuffer = static_cast<LPTSTR>(_alloca((len+1)*sizeof(TCHAR)));
int res = SendMessage(hwndEdit, WM_GETTEXT, len+1, reinterpret_cast<LPARAM>(pBuffer));
if (res == 0)
{
cerr << "Text empty?!?" << endl;
return -4;
}
#ifdef UNICODE
wcout << _T("Calculator's result: ") << pBuffer << endl;
#else
cout << _T("Calculator's result: ") << pBuffer << endl;
#endif
return 0;
}
It's a console application.
Steve
|
|
|
|
|
Hi i am quite new in MFC but know C++ programing and done work in VC 6 using win32 console application now switching to MFC. So please tell me how can i add images button? How can i change the colors of dialouge boxes. I shall be very thankfull to you.
Regards:
Xohaib Shirani
|
|
|
|
|
CImage m;
m.Load(_T("c:\\1.jpg"));
m_Button.SetBitmap(m.detach());
but if you want to use of bitmaps you can use of LoadImage.
|
|
|
|
|
Dear i tell you that i am quite new in MFC so plz guide me where i have to put this code
CImage m;
m.Load(_T("c:\\1.jpg"));
m_Button.SetBitmap(m.detach());
??
Regards:
Xohaib Shirani
|
|
|
|
|
So you need to more info,Ok.
First you must load your image with LoadImage or CImage class or GDI+,...
After load your image you will be have a handle to that image file then you can use of this handle at control that you want to use it.
For example I guess you have a Static control and you want to insertimage to it:
//(1)Declare a variable of CImage
#include "atlImage.h"
CImage m;
//(2) load image file (you need to path of file
m.Load(_T("c:\\1.jpg"));
//(3) set control to that image file
m_Static.SetBitmap(m.detach());
|
|
|
|