|
|
i want to redirect (windows logo key +D) to another windows shortcut key (windows logo+M), is there any way to do this using C# ?
|
|
|
|
|
See: RegisterHotKey function in MSDN
Tip: perform a search on google "registerhotkey site:msdn.microsoft.com"
Alex Korchemniy
|
|
|
|
|
i know this, but its still not the solution coze first i have to catch the message of (win logo+D) then disable it -(all the time when my program is running)- and then send another message (win logo+M)
thats all
|
|
|
|
|
hi to all,
i am trying to get all registered file extensions on a system so i can filter queries to the filesystem that is displayed in a ListView Control
i am iterating the subkeys of CLASSES_ROOT but i am getting alot of keys that do not appear within the display of the Windows 'add new file type' list box. is there a way to only get this list of extensions ?
i will paste my code which basically just gets all subkey names starting with '.'
<br />
public IList<string> GetFileTypes()<br />
{<br />
IList<string> fileTypes = new List<string>();<br />
RegistryKey root = Registry.ClassesRoot;<br />
string[] subkeys = root.GetSubKeyNames();<br />
<br />
foreach (string key in subkeys)<br />
{<br />
if (key.StartsWith("."))<br />
{<br />
fileTypes.Add(key.Substring(1));<br />
}<br />
}<br />
return fileTypes;<br />
}<br />
thanx to all,
g00fy
|
|
|
|
|
ok so i can get them now without any problems, the same as MS file types window but the icon is not displayed, y is this so ?
i am definitley getting the icons (both large and small) i can see it when debugging, but they dont appear in listview control, my code is long so i will have to email if someone can help but i am basically
...
iterating the registry keys to find file types, adding the small and large icons to thier respective imagelists (iteratively) and then adding the string array of extension and description to the listviews items list (also iteratively).
...
this is all done in InitaliseValuesInControl()
<br />
public FileTypeControl()<br />
{<br />
InitializeComponent();<br />
<br />
handler = new IconHandler();<br />
fileEntries = new Dictionary<string, FileType>();<br />
<br />
InitaliseValuesInControl();<br />
<br />
}<br />
i have tried to pull all code from InitializeComponent() and put it into the InitaliseValuesInControl() method so i was drawing the control after the imagelists and item list were populated but it still doesnt display the image.
any ideas please ?
kind regards,
g00fy
|
|
|
|
|
I fixed it, found an overload method i could use
|
|
|
|
|
I am using a dllimport of SHGetFileInfo to retrieve a file icon, and then add it to an image list.
is there something i need to disposse ?
this line
<br />
this.iconsListSmall.Images.Add( FileGetIcon( fi.FullName, true ) );<br />
and this function
<br />
public static Icon FileGetIcon( string strPath, bool bSmall )<br />
{<br />
<br />
SHFILEINFO info = new SHFILEINFO( true );<br />
uint cbFileInfo = ( uint )Marshal.SizeOf( info );<br />
SHGFI flags;<br />
if ( bSmall )<br />
flags = SHGFI.Icon | SHGFI.SmallIcon | SHGFI.UseFileAttributes;<br />
else<br />
flags = SHGFI.Icon | SHGFI.LargeIcon | SHGFI.UseFileAttributes;<br />
<br />
SHGetFileInfo( strPath, 256, out info, cbFileInfo, flags );<br />
return System.Drawing.Icon.FromHandle( info.hIcon );<br />
}<br />
|
|
|
|
|
Well if you search google: "SHGetFileInfo site:msdn.microsoft.com"
You will see towards the bottom of the page: If SHGetFileInfo returns an icon handle in the hIcon member of the SHFILEINFO structure pointed to by psfi, you are responsible for freeing it with DestroyIcon when you no longer need it.
Alex Korchemniy
|
|
|
|
|
so should i
<br />
icotmp = FileGetIcon( fi.FullName, true );<br />
this.iconsListSmall.Images.Add( icotmp );<br />
<br />
DestroyIcon( icotmp.Handle );<br />
or
<br />
icotmp.Dispose();<br />
or should i free it in FileGetIcon() before returning the copied icon in a system.drawing.icon
<br />
FileGetIcon()<br />
..<br />
DestroyIcon( info.hIcon );<br />
Icon ico = System.Drawing.Icon.FromHandle( info.hIcon );<br />
return ico;<br />
|
|
|
|
|
Hello! (Two posts in a row!)
Question now is, how do I take screenshots in C#? I searched for articles but the only one I found was for C++...
Thanks!
Darth_Sulfur (Sulfurik)
http://www.SulfurSoft.tk
ftp://tsfc.ath.cx
http://tsfc.ath.cx
hotline://tsfc.ath.cx
|
|
|
|
|
|
Yep, just what I needed! Thanks!
Darth_Sulfur (Sulfurik)
http://www.SulfurSoft.tk
ftp://tsfc.ath.cx
http://tsfc.ath.cx
hotline://tsfc.ath.cx
|
|
|
|
|
Hello everybody!
OK, does anyone know of a paint control, similar to the one in MS Paint?
Thanks!
Darth_Sulfur (Sulfurik)
http://www.SulfurSoft.tk
ftp://tsfc.ath.cx
http://tsfc.ath.cx
hotline://tsfc.ath.cx
|
|
|
|
|
|
Thanks!
I'll try to extract the thing from the code. Thanks!
Darth_Sulfur (Sulfurik)
http://www.SulfurSoft.tk
ftp://tsfc.ath.cx
http://tsfc.ath.cx
hotline://tsfc.ath.cx
|
|
|
|
|
Does anyone know how to write a function in c# to connect with a modem and report back to the caller the result using th MS Comm Control in .Net?
Thanks
Chris
|
|
|
|
|
i want to know how much bandwidth the computer connected
to the internet used and when the internet is idle
i mean no app or user access the internet
thanks in advance
|
|
|
|
|
I've been trying to code two apps recently, a client and a server. The client will try to send 7 strings to the server, which will then store them in string variables again. The problem I've been having is that the messages arrive jumbled up. I scrapped the code after working on it for hours . Anyway, to cut a long story short I could really use some example code, the only requirement is that the server code can be run in a new thread.
Many thanks,
Paul
|
|
|
|
|
hey all,
i'm tring to select a tree node automaticly when a user types the search string in a text box, I currently have the textbox set to scroll the treeview to the result of the query, but it does not select it, the root node is still selected. I have tried everything i can think of and nothing works,
I would like for it to do like the windows help does when you type your search string into the text box, it scrolls asyou type each letter till it finds the full string value of what you typed.
thanks
|
|
|
|
|
So, you already got the node that should be selected? then it's easy: set the SelectedNode property of the tree view and that's it.
treeView.SelectedNode = nodeThatIFound; I hope this helps!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Tried that....doesn't work (at first) cause i was trying to use it outside the method it was being created it. so now that i got over my stupidity and took a guess at putting it inside the method it works beautifully..
thanks for the help,
- - !!!
|
|
|
|
|
You're welcome! I'm glad it helped!!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I am trying to implement security in Asp.net. I designed three pages login.aspx, WebForm1.aspx and WebForm2.aspx.. Every user should first login before accessing WebForm1.aspx and WebForm2.aspx. But my security fails when any user save the address of WebForm1.aspx and directly access it. In other word he may bypass login page. Can anyone solve this problem? thanx
|
|
|
|
|
hi there,
u should post this in asp.net/web deveplopment thread for getting expert's answers
BTW, u can implement the security by checking session. if users access directly webform1.aspx, in this page u must check the info in session whether it's valid or not
hope this helps
<< >>
|
|
|
|