Jump to content

_Setcontextmenu


SimpsoN_Bart
 Share

Recommended Posts

[font=lucida sans unicode', 'lucida grande', sans-serif]Yaptığımız bazı çalışmaları sağ tık menüsüne ekleyerek onunla çalışmasını sağlamak için böyle bir fonksiyon geliştirdim. Örneği kendini projenize göre düzenleyebilirsiniz .
Umarım faydalı olmuştur..[/font]


 

_SetContextMenu('Programı bununla aç', 1, 1)
MsgBox(64, "Bilgi", "Bu programla aç")

;~ $fFlag | Klasördeki Sağ tık menüsü için (menü eklemek için 1 silmek için 0 değerini girin)
;~ $sFlag | Tüm dosya uzantıları için (menü eklemek için 1 silmek için 0 değerini girin)
;~ $context | Menüye isim yazmak için
Func _SetContextMenu($context, $fFlag = 0, $sFlag = 0)
	If $fFlag = True And @Compiled Then
		RegWrite("HKEY_CLASSES_ROOT\Folder\shell\My Program", "", "REG_SZ", $context)
		RegWrite("HKEY_CLASSES_ROOT\Folder\shell\My Program\command", "", "REG_SZ", '"' & FileGetShortName(@ScriptFullPath) & '" /Folder: "%1"')
	Else
		RegDelete("HKEY_CLASSES_ROOT\Folder\shell\My Program")
	EndIf
	If $sFlag = True And @Compiled Then
		RegWrite('HKEY_CLASSES_ROOT\*\shell\My Program', '', 'REG_SZ', $context)
		RegWrite('HKEY_CLASSES_ROOT\*\shell\My Program\command', '', 'REG_SZ', '"' & FileGetShortName(@ScriptFullPath) & '" "%1"')
	Else
		RegDelete("HKEY_CLASSES_ROOT\*\shell\My Program")
	EndIf
	Return 0
EndFunc   ;==>_SetContextMenu

 

https://www.box.com/s/zbhbr35gyitazaoj09ep

 

 

Edited by SimpsoN_Bart
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...