|
You may go through subclassing, see, for instance [^].
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
[My articles]
|
|
|
|
|
Hi all,
i want to find all types of image files those are present in my computer .
and display them by thumbnail view.
please help me for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I dont know of any simpler way than using CFileFind::FindFile to enumerate through all files, find if they are image files and then if they are then extracting the bitmap from them using Gdiplus and then storing that bitmap for subsequent display.
umm... what do you think?
|
|
|
|
|
theCPkid wrote: what do you think?
Sounds like an excellent suggestion!
|
|
|
|
|
hehehehe.. who knows he may have something better to say about my approach and in criticizing or approving that, he may arrive at better solution. moreover, i am trying to bring spiritual touch to my programming skills and I believe that our inner soul knows all the answers. only they need to be brought to surface. glad you appreciate it.
|
|
|
|
|
i'd just store the filename, then read the bitmap when it was time to display. otherwise... that could be a lot of stored bitmaps.
|
|
|
|
|
go to search and then select files&folders then type which type u want .(.jpg,.bmp)
|
|
|
|
|
Hi all,
VC++(MFC) 6.0
I have to open my application only one time,for that I am using folllowing code
HANDLE hMutex;
hMutex = CreateMutex(NULL,TRUE,TEXT("vision client"));
if(hMutex == INVALID_HANDLE_VALUE)
{
AfxMessageBox("Unable to create Mutex");
}
else
{
if(GetLastError()==ERROR_ALREADY_EXISTS)
{
HANDLE proc_h = GetCurrentProcess();
AfxMessageBox("Application is already Opened !!!");
_exit(0);
}
}
But Instead of closing the application I have to activate the application .
Please help me.
Ranjith
|
|
|
|
|
You could try registering a custom window message on the system using RegisterWindowMessage[^], when you want to activate your app, broadcast this message using BroadcastSystemMessage[^], in your application make a handler for this message and use SetForegroundWindow[^] or some such to activate your application.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Thanks,
I am new to VC++ ,can anybody give me an example please;
ranjith
|
|
|
|
|
I dont really understand your question but try the following and tell me if it is what you really want??
HANDLE hMutex;
hMutex = CreateMutex(NULL,TRUE,TEXT("vision client"));
if(hMutex == INVALID_HANDLE_VALUE)
{
AfxMessageBox("Unable to create Mutex");
}
else
{
if(GetLastError()==ERROR_ALREADY_EXISTS)
{
HANDLE proc_h = GetCurrentProcess();
CWnd* pMainWnd = AfxGetMainWnd();
pMainWnd->SetActiveWindow();
pMainWnd->BringWindowToTop();
AfxMessageBox("Application is already Opened !!!");
_exit(0);
}
}
I have only inserted the lines in bold.
|
|
|
|
|
Thanks,
It's returning NULL in pMainWnd ...
If this is the case I have get the main window handle...
HANDLE hMutex;
hMutex = CreateMutex(NULL,TRUE,TEXT("vision client"));
if(hMutex == INVALID_HANDLE_VALUE)
{
AfxMessageBox("Unable to create Mutex");
}
else
{
if(GetLastError()==ERROR_ALREADY_EXISTS)
{
AfxMessageBox("Application is already Opened !!!");
_exit(0);
}
}
The above code will ristrict the application to open mutliple instances.And it gives the message like "Application is already Opened !!!" . and closes the second instance[_exit(0)].
Instead of giving message I have to activate (maximize)the application if user clicks again on the application icon.
|
|
|
|
|
If you have the handle to window you want to activate, use SW_MAXIMIZE or SW_RESTORE flag of SetWindowPos?
|
|
|
|
|
I donot have the mainwindow handle....
|
|
|
|
|
haha.. so that is the problem.
how about using FindWindow() function? Inside the MainFrame::OnCreate, give a name to your window using SetWindowText and then you can use FindWindow to find the window that matches the name you gave earlier. that is one of the ways.
SetWindowText("My magic window");
If mutex already exists,
HWND hWnd = FindWindow(NULL, "My magic window")
if(hWnd && ::IsIconic(hWnd))
//maximize or restore it
//bring it to top or set it as foreground window
modified on Saturday, September 19, 2009 7:17 AM
|
|
|
|
|
Imho FindWindow isn't really reliable, not to mention that fiddling with windows created by other processes isn't healthy...what's wrong with the message broadcast aproach?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Can any one give me findwindow() example..
|
|
|
|
|
How about searching on CP for single instance application articles? Then you'd have found this one[^], for example.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hai all ,
I have created an application in VC++ using VS2008 in a development machine which runs on Vista, now i need to run that application in a target machine which runs on windows XP SP2 which does not have vc++ dlls or any thing.
i need a help for redistributing the dependent dlls for the application so that it should run well in target machine.
this is the manifest file created for the application ...
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.4053' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
can any one tell what all the files needed to be redistributed with my application
thanks in advance,
Jerin
|
|
|
|
|
Your problem is not simple unfortunately.You would better first use Dependancy Walker to detect dll dependancies and next test your app on guest OS running under Microsoft Virtual PC or VMWare.
Life is a stage and we are all actors!
|
|
|
|
|
Hi
I would like to find function which can chanege a value in data base.
Something like GetFiledValue but which writes value into record
thanks in advance
Rafal
|
|
|
|
|
I can not find a good multiple installation software, so I want to do some test to determine if I can setup installation pack myself:
First question is:
How to add Items to Windows start menu and link user click to related file (exe, chm etc.)?
|
|
|
|
|
Ummm - create a shortcut to the exe or chm in a folder in the start menu - either the All Users start menu (for an 'All Users' install) or the current users start menu. The start menu location can be retrieved with SHGetSpecialFolderPath[^]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
you can send email to me i'm the author kyzhao
|
|
|
|