|
I'm trying using templates now. Thanks.
|
|
|
|
|
I have a thread function and I define it as global function:
This function get the focused window and change the position of it.
BOOL bdown = false ;
UINT ThreadFunc(LPVOID pparam)
{
WINDOWINFO info;
HWND hwnd;
DWORD dword;
hwnd = (HWND)GetForegroundWindow();
GetWindowThreadProcessId( hwnd , &dword);
AttachThreadInput( dword , GetCurrentThreadId() ,true);
hwnd = GetFocus();
if(hwnd != NULL)
GetWindowInfo( hwnd ,&info );
else
{
hwnd = (HWND)GetForegroundWindow();
GetWindowInfo( hwnd ,&info );
}
if(hwnd!=NULL)
{
int x = info.rcWindow.left;
int y = info.rcWindow.top;
int width = (info.rcWindow.right-info.rcWindow.left);
int height = (info.rcWindow.bottom-info.rcWindow.top) ;
if(bdown)
y -= 90;
else
y += 90;
SetWindowPos(hwnd , HWND_NOTOPMOST , x , y , width ,height , SWP_SHOWWINDOW);
if(bdown)
bdown = false;
else
bdown = true;
Sleep(1000);
}
return 0;
}
I start thread in my OnInitDialog of my class like this:
AfxBeginThread(ThreadFunc, 0);
The problem is that if when I call the function without starting thread it works and change the position but when I start the thread nothing happend.also when I debug my application it change the postion for one time and it seems that it does not called another time.Any idea?
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Your thread function executes once and then returns - the thread finishes. Some kind of loop is missing.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Yes,thank you man.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Hi,
My application does not have a title bar due to space constraints.
I need to add the minimize, maximize and close buttons (which are normally on the title bar) to the menu bar.
Any ideas on how I can do this would be greatly appreciated.
Thanks.
|
|
|
|
|
you could draw some bitmaps and import them to your resources and use the CButtonST class to give the button a normal look. Take a look the follwing article about CButtonST http://www.codeproject.com/buttonctrl/cbuttonst.asp
Hope this helps...
Best Regards
Sonu Kapoor
|
|
|
|
|
|
|
I have searched a single tutorial which will explain me a simple device driver in vC++.
But I could'nt found any tutorial as such.
Does any body knows
|
|
|
|
|
Yes, but unless you tell us exactly what operating system you want to do it for it's impossible to answer.
For at least NT drivers you can download the DDK from Microsft. Not that it's probably well over 100MB.
|
|
|
|
|
yes i want this on windows nt or 2000
|
|
|
|
|
Hi,
Anyone know how I can integrate MSDN Library with VC++.NET so when I press F1 the MSDN is to be open (not the local help in VC++.NET )??
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
Tools...Options...Help...External Help
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I know that ... but it open 'Microsoft Document explorer' with "MSDN Library - Visual Studio .NET" open.
I want to open " MSDN Library - October 2001" with "MS HTML Help"
Thanx
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
You need the newest MSDN Library. The old ones don't integrate into VS.NET
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Thanx ... I've just activate my subscription a few days ago ... do you hapen to know if they will send my the new MSDN Library as an update???
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
Orbital^ wrote:
do you hapen to know if they will send my the new MSDN Library as an update
As far as I know they do...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I have made this function that takes a pointer to a ITEMIDLIST as a parameter that points to a folder and then loops through the items in the folder. If it is a file it adds it to the listview control, and if it is a folder it calls itself. But when it encounters a folder and calls itself the first time, the EnumObjects function fails. The ITEMIDLIST i pass in the function is the return value of the SHBrowseForFolder function. Anyone know what's wrong? Here's the code:
void AddFilesFromFolder(ITEMIDLIST *pIdl)
{
if (pIdl)
{
IShellFolder *pBrowse = NULL;
LPENUMIDLIST pFolder = NULL;
LPMALLOC pMalloc = NULL;
ITEMIDLIST *pNewId = NULL;
STRRET strDispName;
LVITEM lvItem;
RECT rMain;
RECT rAdd;
char szCurrentFile[MAX_PATH+1+5];
char szFolderPath[MAX_PATH+1];
DWORD pActual = 0;
DWORD dwAttrib;
IShellFolder *CurrentFolder;
HRESULT err;
err = SHGetDesktopFolder (&CurrentFolder);
if (err == NOERROR)
{
SHGetMalloc(&pMalloc);
CurrentFolder->BindToObject(pIdl, NULL, IID_IShellFolder, (LPVOID*)&pBrowse);
pBrowse->GetDisplayNameOf(pIdl, SHGDN_INFOLDER, &strDispName);
err = pBrowse->EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &pFolder);
if (err == NOERROR)
{
SHGetPathFromIDList(pIdl, szFolderPath);
lvItem.mask = LVIF_IMAGE | LVIF_TEXT;
while (pFolder->Next(1, &pNewId, &pActual) != S_FALSE)
{
dwAttrib = SFGAO_FOLDER;
pBrowse->GetAttributesOf(1, (LPCITEMIDLIST*)&pNewId, &dwAttrib);
if (!(dwAttrib & SFGAO_FOLDER))
{
pBrowse->GetDisplayNameOf(pNewId, SHGDN_INFOLDER, &strDispName);
PathCombine(gszPath, szFolderPath, strDispName.cStr);
GetID3();
FillInfo();
ListAddItem();
}
if (dwAttrib & SFGAO_FOLDER)
{
pBrowse->GetDisplayNameOf(pNewId, SHGDN_INFOLDER, &strDispName);
AddFilesFromFolder(pNewId);
}
}
pMalloc->Free(pNewId);
pMalloc->Release();
gbFileOpen = true;
pFolder->Release();
}
CurrentFolder->Release();
}
}
}
Thankyou all!
|
|
|
|
|
I think the problem is that the pidls you get from EnumObjects() are realative to the folder
you are enumerating and your function is expecting a complete pidl.
(Make a recursive function that takes an IShellFolder * arg instead)
/Magnus
|
|
|
|
|
But how do i then get the IShellFolder interface for the current folder in the loop?
|
|
|
|
|
What do you mean with the current folder?
The current is the one passes as a param in that case.
You could to it someting like this.
start(pidl)
{
get_folder_from_pidl();
enum(folder);
}
enum(folder)
{
if(is folder)
enum(folder);
}
/Magnus
|
|
|
|
|
Does Acrobat 5.0 install a virtual printer Acrobat PDFWriter ? If not, how can i convert a MS Office document to PDF in a given path ?
Thanks.
Aziz Rajim
|
|
|
|
|
Aziz Rajim wrote:
Does Acrobat 5.0 install a virtual printer Acrobat PDFWriter
I believe so. Acrobat 3 did.
John
|
|
|
|
|
Those of you who have been following my PGP encoding problems with regard to RSA keys might be interested in knowing that the issue was with the debug mode DLLs that are supplied with PGP SDK 1.7.8
If you use the DLLs that come with PGP SDK 1.7.2 this problem will not occur. You can use the newer headers and libs, but use the older DLLs.
Of course if you actually have a full PGP installation then you need to distribute the DLLs as the DLLs are available in the system folder.
Kind regards
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
how to write a small debugger?
|
|
|
|