|
You need to write a completely new Explorer implementation. However, I cannot help you with this any further, as writing this type of implementation would be a huge job.
For an example, see the desktop replacement software called LiteStep. This program is a replacement for the standard Windows Shell (Explorer). Perhaps it has some free source code that will get you started.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
wrong again!
the multiple desktop feature doesn't come from the explorer, it's a system feature coming from the win32 subsystem in kernel.
Don't try it, just do it!
|
|
|
|
|
hi...
i have a problem in invalidating...
below are my codes
void CEditorView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
if( lHint == 1 ) {
//get back the rect
CRect* pRect = ( CRect* ) pHint;
InvalidateRect(pRect);
return;
}
CView::OnUpdate(pSender, lHint, pHint);
}
which are taken from the OnUpdate handler of my View..
the way OnUpdate is called from my DOC is as below :
void CEditorDoc::SetSquareColor(int i, int j, COLORREF color)
{
ASSERT( i >= 0 && i <= GetGridY() && j >= 0 && j <= GetGridX() );
m_clrGrid.At(i, j) = color;
SetModifiedFlag(TRUE);
CRect pRect( 20, -10, 30, -20 );
UpdateAllViews( NULL, 1, ( CObject* )&pRect);
}
THE PROBLEM
the problem arrives when i do InvalidateRect, the rect passed in as parameter is bnot getting invalidated!!
Now, to check if my parameter is wrong i added code in the OnUpdate to draw a rectangle with the same coordinates.
so now the same code above becomes :
void CEditorView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
if( lHint == 1 ) {
//get back the rect
CRect* pRect = ( CRect* ) pHint;
InvalidateRect(pRect);
CBrush brush(RGB(255,166,166));
CBrush* pOldBrush = dc.SelectObject(&brush);
CRect jrtRect(20, -10, 30, -20);
dc.Rectangle(jrtRect);
dc.SelectObject(pOldBrush);
Invalidate();
return;
}
CView::OnUpdate(pSender, lHint, pHint);
}
what i found out that with the above code, a rectange is drawn in the correct place where i wanted to invalidate the rect!!!
but the rectangle apprears and quickly dissapears!!
so now i know that the co-ordinates i supplied witht the invalidateRect were correct...
then why doesnt the area get Invalidated??
any help is deeply appreciated and thank you for your time...
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
I am wondering, since u can pass a style LBS_SORT to the listbox when Initalized. But is there a flag that I can pass to SetDlgItemMessage(...) to sort the LB when I push a button ??? I dont want to have to write my own Sorting function to sort strings Alphabetically.
Thanks
|
|
|
|
|
if u set the style it will insert new items in a sorted order
so why would u want to sort it urself?
"there is no spoon" biz stuff about me
|
|
|
|
|
I think what you want is to change the sorting style of the listbox at runtime. Try SetWindowLong(..) in your button handler.
Art
|
|
|
|
|
Exactly thats what I was trying to do at runtime sort the items in the LB.I will try SetWindowsLong(...)
|
|
|
|
|
You can not use SetWindowLong(...)for a list box, causes the program to freeze.
|
|
|
|
|
Don't know why you are getting that.
Here is my code:
----------------------------------
DWORD dwStyle = m_lb1.GetStyle();
dwStyle |= LBS_SORT;
::SetWindowLong(m_lb1.GetSafeHwnd(),GWL_STYLE,dwStyle);
-----------------------------------
A check with spy++ clearly shows the listbox style has changed from no sort to sort. However the sorting operation doesn't occur. Don't know why. Sorry. It doesn't freeze the app though.
Art
|
|
|
|
|
Read this:
http://www.codeproject.com/combobox/recreatelistbox.asp
Art
|
|
|
|
|
Mine does not work either this is my code
-------------------------------------------------------
int x = SetWindowLong(dhwnd,GWL_STYLE,GetWindowLong(dhwnd,GWL_STYLE)|LBS_SORT);
SendDlgItemMessage(dhwnd,IDC_LIST1,LB_RESETCONTENT,0,0);
for(int i=0; i<6; ++i)
SendDlgItemMessage(dhwnd,IDC_LIST1,LB_ADDSTRING,0,(LPARAM)table[i].list);
SendDlgItemMessage(dhwnd,IDC_LIST1,LB_SETCURSEL,0,0);
SetDlgItemText(dhwnd,IDC_EDIT1,table[0].list);
-------------------------------------------------------------------------
I dont think I am getting the handle to the listbox
|
|
|
|
|
I have not explained this very. I created a listbox using the resource editor. The problem is I cant set the style to a LB because the resource editor set all the flags. But I assume u can change the style using SetWindowLong(...) but nothing happens. Is there a way I can get a handle to the listbox. This is win32 and not MFC.
|
|
|
|
|
Is there a util that will do this? Does the Borland free compiler even possibkly know how to read them?
I want to take a project I have and convert it to compile and link using borland's free compiler
It's an SDK, so I'm not concerned w/ MFC
Cheers
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
To my knowledge none of the Borland C++ programs understand visual studio projected/solution files. However, Visual Studio 6.0 has the option to create a make file, which you could modify to work with the Borland compiler.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
do u know how to get character matrix in win and dos?
e.g:
1 character matrix is similar to that:
0000x0000
0000x0000
0000x0000
0000x0000
0000x0000
Thank you!
Hello World!
|
|
|
|
|
char buffer[20];
int iYourNumber = 0;
sprintf( buffer, "%x", s );
Convert it to HEX?
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
In VC6.0,how to change a project from Release to Debug for debuging it?
Thank you very much first!
Rap off for you,for me,for our human.
|
|
|
|
|
Look on the Build toolbar, there's a combo box that says "Win32 Release". Change that to "Win32 Debug"
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
Right click on the top and make sure that you select:"Build" and then change it in the combo box
|
|
|
|
|
Or if you want to debug in release mode, in your linker option.
Project Setting - Link - check the Generate Debug Info
and
Add #define _DEBUG into your source code.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I'm trying to use DllMain() to take care of some library/thread initialization and cleanup stuff, but no matter what I try I cannot get DllMain invoked for any of the four events for which it is supposed to be getting invoked! (I.e., process attach, thread attach, thread detach, process detach.)
I found the following sentence in the MSDN description of DllMain():
"DllMain is a placeholder for the library-defined function name. You must specify the actual name you use when you build your DLL. For more information, see the documentation included with your development tools."
Is there some Dev Studio project setting I should be making to identify the name of my library entry point function?
Another tidbit of information: I'm using simple load-time linking for my DLL. The MSDN DllMain description makes reference to LoadLibrary and FreeLibrary (functions you use for run-time dynamic linking). I sould be interested in hearing confirmation that DllMain IS compatible with simple load-time dynamic linking.
Thanks much,
Matt
|
|
|
|
|
Matthew,
further to your (previous) question:
DllMain of your *.dll library gets called on
1.program startup, if your user staticly linked to the *.lib library of your *.dll project when compiling his app. (also called load time or explicit linking)
2.your user calling LoadLibrary, FreeLibrary from his code (also called runtime or implicit linking)
In case 1./ the user of your library has to get from you a *.lib and a *.h file of your library in order to compile his project, and of course your *.dll to run with your *.dll attached.
In case 2./ the user of your library has to get from you an *.h file of your library (i.e. function prototypes) to compile his code (by calling LoadLibrary, GetProcAddress and FreeLibrary) and your *.dll to run the library functions.
Peter Molnar
|
|
|
|
|
Peter,
Thanks for your confirmation that this at least should work. So why then is my DllMain not getting invoked. Here's my current inplementation:
#include "MyHeader.h"
#include "windows.h"
BOOL DllMain(HINSTANCE , DWORD pReason, LPVOID ) {
try {
printf("I'M HERE!\n");
int *x = NULL;
*x = 20;
switch (pReason) {
case DLL_PROCESS_ATTACH:
MyProcessAttach();
MyThreadAttach();
break;
case DLL_THREAD_ATTACH:
MyThreadAttach();
break;
case DLL_THREAD_DETACH:
MyThreadDetach();
break;
case DLL_PROCESS_DETACH:
MyThreadDetach();
MyProcessDetach();
break;
default:
break;
}
}
catch(std::exception& x) {
std::cerr << x.what() << std::endl;
return FALSE;
}
return FALSE;
}
where all the stuff in bold is just some garbage I've added trying to get it to print something, or crash or generate some failed load situation to show me that the function is getting called. It would certainly seem this function is never getting invoked. What the heck is going on?
Again, do I need some project setting to identify this as an entry point function for the library?
Matt
|
|
|
|
|
I have created a small project which contains 4 lines of code:
#include <windows.h>
BOOL DllMain(HINSTANCE , DWORD , LPVOID )
{
::MessageBox(NULL,"test","Caption",MB_OK);
return TRUE;
}
and call it
HINSTANCE hInstance = LoadLibrary("pathto.dll");
works just fine.
Try the same. What is hInstance when you debug?
Peter Molnar
|
|
|
|
|
Much thanks to Peter Molnar for mailing me a completely trivial DevStudio project containing a DllMain() that got properly invoked. What I was missing (and what I had never seen documented) was the APIENTRY declaration for the DLL entry point function. The DllMain must be declared like this:
BOOL APIENTRY DllMain(HINSTANCE , DWORD , LPVOID )
Once those 8 pesky characters were added, it worked great.
Also, for those who care, this works independently of the application type (i.e., works for both console apps and windows apps) and (as Peter said in an earlier message on this thread) works independently of how the library is loaded. (I.e., you can use either load-time dynamic linking or run-time dynamic linking.)
Matt
|
|
|
|