|
Dir forum,
I want to delete some files in system folder likes "c:\\windows\\temporary internet files\\*.*"
But when I use some code like this, it don't run well.
SHFILEOPSTRUCT sh;
sh.hwnd = GetSafeHwnd();
sh.wFunc = FO_DELETE;
sh.pFrom = "c:\\windows\\temporary internet files\0";
sh.pTo = NULL;
sh.fFlags = FOF_NOCONFIRMATION | FOF_SILENT;
sh.hNameMappings = 0;
sh.lpszProgressTitle = NULL;
SHFileOperation (&sh);
Any ideas???
Please help me!
Thank you very much!
|
|
|
|
|
Hi, i need some help with detecting when a CD is inserted or ejected from a drive. I've tried to override get the message handler...
afx_msg BOOL CWnd::OnDeviceChange( UINT nEventType, DWORD dwData );
but it doesn't seem to be called? The docs say that the WM_DEVICECHANGED message is sent to all top level windows? so shouldn't all the apps get this message.
If anyone has any code for this it would be really helpful
Thanks.
Jared Allen.
|
|
|
|
|
Where can get a copy of source code of MPEG2/MPEG4 codec for windows and free of fee?If they are there,please tell me the URL or links.thank you.
Scratch
|
|
|
|
|
I like to write a program to delete some special folder. I try this code but it generate error : "Can not delete file: file system error (1026)".
SHFILEOPSTRUCT sh;
sh.hwnd = GetSafeHwnd();
sh.wFunc = FO_DELETE;
sh.pFrom = "c:\\windows\\temporary internet files\0";
sh.pTo = NULL;
sh.fFlags = FOF_NOCONFIRMATION | FOF_SILENT;
sh.hNameMappings = 0;
sh.lpszProgressTitle = NULL;
SHFileOperation (&sh);
please help me!
Thank you very much!
BUNG
|
|
|
|
|
Hi everybody.
I have to capture Dial-In connections to a server,
Can every body give me a sample code in VC++?
Help me please,
Regards.
|
|
|
|
|
I'm looking for some code that will manage the display of a storyboard
found in most digital film editors like Adobe Premiere, Macromedia Director,
ULead VideoStudio, etc. Anyone seen anything out there?
|
|
|
|
|
Thanks give some code to me.
Mail to : hellopk@163.com
|
|
|
|
|
how to reset the autonumber id when deleting records in a table......meaning how to have the id starting at 1 again
|
|
|
|
|
In Access, first delete the rows, then switch to design mode, change the datatype of the autonumber field to whatever, save the table. Change back and save again!. This can only be done on an empty table (I think), and I am not sure you can do it externally. If it is possible you would need to drop and then create the table using SQL syntax.
Consultant, system/web developer.
IMS Consulting AB, Sweden
|
|
|
|
|
Another way to do it is after deleting the rows compact the database.
Best regards,
Mark
www.mjsoft.co.uk
|
|
|
|
|
I'm looking for code samples for the Navigate2 function. Can anyone point me in the right direction?
|
|
|
|
|
Have you tried the following?
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/WebBrowser.asp
|
|
|
|
|
Hi there!
I'm looking for the way for the hands off install of the new printer driver on multiple workstations. I've tried to do it myself according to MSDN (AddPrinterDriver, AddPrinter, ...) with no success.
I don't want to invent the wheel any more, so I'll be very thankful for any trick, tip, link, etc. concerning:
1. Ready to use utility for this purpose (if any exists).
2. Article with good explanation of the driver installation process.
3. Tools for INF file processing/interpreting, especially INF file for printer driver.
Thanks in advance.
Regards,
Gennady
|
|
|
|
|
Hi!
Does anybody know where it is possible to obtain a free C++ source code for BCD or String Arithmetic (the last one is even better for me). The problem is I'm developing some Banking SW, so I can't use a floating point arithmetic in it, because it is prohibited by the country law. The only solution I know at the moment is to use the RogueWave RWDecimal<> template class. But the RW library is huge and imho ugly, I don't want to be tied to it. In addition, I need not so much functionality: only '+', '-', '*', and probably '/' operation... Could you help?
PS: Of course, it is possible to start writing the necessary class from scratch, but better is to take somebody's code and adjust it for my needs.
Best Regards,
Dmitry Leonov
|
|
|
|
|
Hi there,
If you have some source code to lock some key
in the keyboard, F1 .. F12 and Ctrl and Alt and Shift,
please send it to me!
Thank you very much!
|
|
|
|
|
I have searched this forum but havent come up with any useful results. I simply want to be able to read the input from a bitmap file, nothing fancy, I dont want to display bitmaps, just be able to access the value of a pixel at (x,y).
Any ideas/ places I can learn more about this/ code I can use?
Any help is appreciated...
cbb@andrew.cmu.edu
Cassidy
|
|
|
|
|
Is it true that bitmaps are just a collection of paired bytes? When you open a bitmap (in hex format), you can see the "lines" that comprise to sequence of on/off bits.
Try creating a small 4x4 or 16x16 bitmap with known values:
0110 = 0x06
1001 = 0x09
0101 = 0x05
1111 = 0x0F or if adventerous,
0101010101010101
1010101010101010
0101010101010101
...
(checkerboard pattern)
then you can use byte-size arithmetic to access "x,y" value. x*sizeof(byte)+y*sizeof(byte)
and check against known values for your template bitmap.
Sorry if too abstract, but this may be a lead that you could use.
John
|
|
|
|
|
One of our customers is going to translate the Windows application that we have written for him. The easiest way to achieve this would be for me to send him the resource file. Once translated, I would only have to rebuild the application using this file.
Unfortunately, most of our customers do not have the Visual Studio installed, nor has this customer. Does anyone know a standalone application (preferabely freeware) that would allow one to edit resource (.rc) files in a similar way as in Visual Studio?
|
|
|
|
|
You can directly edit the resources in binaries with VC on NT. Assuming your customer has VC and NT, of course. That way you don't have to rebuild anything.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Another option is to use a program such as ResHacker, which allows you to modify the resources without Visual Studio. It should be avaliable at:
|
|
|
|
|
Sorry, let me try that address again:
http://rpi.net.au/~ajohnson/resourcehacker/
The rest of my message mentioned the Win32 API functions you can use to modify the resources of a binary file at runtime:
BeginUpdateResource
EndUpdateResource
The only problem with these is that the format of the String Table is anything but easy to work out. I certainly couldn't find any documentation for it!
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
I have an app that uses a hosted browser control (IE control) to print using print templates. I would like to pragmatically change the destination printer because currently I'm limited to always printing to the default printer set for IE. So far all of my research has turned up empty. According to MSDN it seems that due to security reason you can't change the printer.
My app is written in VC++ and is hosting the browser control that I'm using to print. If any one has some suggestions on how I can pragmatically change the print I would appreciate the help.
Seems that this is one feature MS overlooked that is really needed if they want you to reuse the browser control in your own apps.
Hawkins
|
|
|
|
|
Hi all,
I'm looking for a function to check wheather a given NT account (not the current!!) has administrator rights.
Has anybody things like that in the pocket?
Best regards,
Jo
|
|
|
|
|
Have a look at the netapi.
Isac
|
|
|
|
|
Hello Johannes,
The following sample code may help you :
#include <windows.h>
#include <lmerr.h>
#include <lmaccess.h>
#include <lmapibuf.h>
void main()
{
WCHAR wszServer[] = L"\\\\server_name";
WCHAR wszUserName[] = L"user_name";
NET_API_STATUS net_api_status = 0;
GROUP_USERS_INFO_0* pgroup_users_info_0 = NULL;
USER_INFO_2* puser_info_2 = NULL;
DWORD dwentriesread = 0;
DWORD dwtotalentries = 0;
net_api_status = NetUserGetGroups
(
(LPWSTR)wszServer,
(LPWSTR)wszUserName,
(DWORD)0,
(LPBYTE *)&pgroup_users_info_0,
(DWORD)8096,
(LPDWORD)&dwentriesread,
(LPDWORD)&dwtotalentries
);
net_api_status = NetUserGetInfo
(
(LPWSTR)wszServer,
(LPWSTR)wszUserName,
(DWORD)2,
(LPBYTE *)&puser_info_2
);
if (pgroup_users_info_0)
{
NetApiBufferFree (pgroup_users_info_0);
pgroup_users_info_0 = NULL;
}
if (puser_info_2)
{
NetApiBufferFree (puser_info_2);
puser_info_2 = NULL;
}
}
The following is a summary :
1. NetUserGetInfo()
1.1 This API will return to you a USER_INFO_2 struct in which the "usri2_priv" field (type DWORD) contains one of the following values :
1.1.1 USER_PRIV_GUEST
1.1.2 USER_PRIV_USER
1.1.3 USER_PRIV_ADMIN
If USER_PRIV_ADMIN is returned, this indicates that the user has Administrator rights.
1.2 When you no longer need this USER_INFO_2 struct, call NetApiBufferFree() to free the memory for it.
2. NetUserGetGroups()
2.1. The motivation behind the use of this API is to get a list of Groups to which a user belongs and then check to see if one of these groups is "Administrators".
2.2. The NetUserGetGroups() API will return to you an array of GROUP_USERS_INFO_0 structs. Each element of the array contains a pointer to a Unicode string which is the name of a Group to which the user belongs. The last two parameters "entriesread" and "totalentries" will help to indicate to you how many elements were returned in the array.
2.3. However, I found this API a little strange in the sense that the "Administrators" group does not seem to be used.
2.4 When I specified "Administrator" as the user name, NetUserGetGroups() returns "None" as the group name.
2.5 However, you can use this API to obtain a list of Groups to which a User belongs.
2.6 Like NetUserGetInfo(), you need to delete the array of GROUP_USERS_INFO_0 structs by calling NetApiBufferFree().
Hope the above will help you, Johannes. Best of luck.
Regards,
Bio.
|
|
|
|