الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف يمكن فتح نوافذ معينه مثل .......

مغلق
بدأه فادي لطف في 21 أبريل 2002 · 4 رد · 893 مشاهدة · في لغة Delphi
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بسم الله الرحمن الرحيم

كيف يمكن أن أقوم بصنع برنامج يقوم بفتح مايلي :

جهاز الكومبيوتر ، لوحة التحكم ( بما تحتويه ) ، السواقة ( C , D ...) إلخ ، السواقة المرنة ( A ) فتح برنامج عن طريق كتابة المسار الموجود فيه كما في ( Run ) الموجودة في القائمة Start .

وشكراً لكم مقدماً وأعتذر عن كثرة أسئلتي ولكن من خبرتكم نستفيد .

#2

السلام عليكم

جرب هذا

//Control Panel
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL',9);
//Accessibility Options "Keyboard"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL access.cpl,,1',9);
//Accessibility Options "Sound"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL access.cpl,,2',9);
//Accessibility Options "Display"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3',9);
//Accessibility Options "Mouse"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL access.cpl,,4',9);
//Accessibility Options "General"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL access.cpl,,5',9);
//Add or remove programs "Change Or Remove Program"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Appwiz.cpl,,0',9);
//Add or remove programs "Add New Programs"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Appwiz.cpl,,1',9);
//Add or remove programs "Add/Remove Windows Component"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Appwiz.cpl,,2',9);
//Display Property "Themes"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,-1',9);
//Display Property "Desktop"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0',9);
//Display Property "Screen Saver"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1',9);
//Display Property "Setting"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3',9);
//Internet Properties "General"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl,,0',9);
//Internet Properties "Security"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl,,1',9);
//Internet Properties "Privacy"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl,,2',9);
//Internet Properties "Content" 
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl,,3',9);
//Internet Properties "Connection"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl,,4',9);
//Internet Properties "Programs"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl,,5',9);
//Internet Properties "Advanced"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl,,6',9);
//Regional and Language Options "Regional Options"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Intl.cpl,,0',9);
//Regional and Language Options "Language"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Intl.cpl,,1',9);
//Regional and Language Options "Advanced"
//Game Controllers
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Joy.cpl,,0',9);
//Mouse Properties "Buttons"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Main.cpl,,0',9);
//Mouse Properties "Pointer"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Main.cpl,,1',9);
//Mouse Properties "Pointer Options"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Main.cpl,,2',9);
//Mouse Properties "Wheel"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Main.cpl,,3',9);
//Mouse Properties "Hardware"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Main.cpl,,4',9);
//Sounds And Audio Devices Properties "Volume"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,,0',9);
//Sounds And Audio Devices Properties "Sounds"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,,1',9);
//Sounds And Audio Devices Properties "Audio"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,,2',9);
//Sounds And Audio Devices Properties "Voice"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,,3',9);
//Sounds And Audio Devices Properties "Hardware"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,,4',9);
//Phone And Modem Options "Modems"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Modem.cpl',9);
//System Properties "General"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,0',9);
//System Properties "Computer Name"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,1',9);
//System Properties "Hardware"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,2',9);
//System Properties "Advanced"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,3',9);
//System Properties "System Restore"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,4',9);
//System Properties "Automatic Updates"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,5',9);
//System Properties "Remote"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Sysdm.cpl,,6',9);
//Time And Date Properties
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL timedate.cpl',9);
//Power Options Properties 
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Powercfg.cpl',9);
//Phone And Modem Options "Phone"
x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Telephon.cpl',9);


if x=0 then messagebox(0,'The system is out of memory or resources','Error',0);
if x=ERROR_BAD_FORMAT then messagebox(0,'Non-Win32 .EXE or error in .EXE image','Error',0);
if x=ERROR_FILE_NOT_FOUND then messagebox(0,'The specified file was not found','Error',0);
if x=ERROR_PATH_NOT_FOUND then messagebox(0,'The specified path was not found','Error',0);

بالنسبة لموضوع (run) جرب الكود الاتي

اضف Button و Edit

procedure ExecNewProcess(ProgramName : String);
var
  StartInfo  : TStartupInfo;
  ProcInfo   : TProcessInformation;
  CreateOK   : Boolean;
begin

  { fill with known state }
  FillChar(StartInfo,SizeOf(TStartupInfo),#0);
  FillChar(ProcInfo,SizeOf(TProcessInformation),#0);
  StartInfo.cb := SizeOf(TStartupInfo);

  CreateOK := CreateProcess(nil, PChar(ProgramName), nil, nil,False,
              CREATE_NEW_PROCESS_GROUP+NORMAL_PRIORITY_CLASS,
              nil, nil, StartInfo, ProcInfo);

  { check to see if successful }
  if CreateOK then
    //may or may not be needed. Usually wait for child processes
    WaitForSingleObject(ProcInfo.hProcess, INFINITE);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
ExecNewProcess(Edit1.text);
end;

في الكود السابق استخدمت الدالة CreateProcess وهو الافضل . يمكن استخدام winexec ,.... .

هناك حتى الأحلام أصبحت ممنوعة ...

إنه لعار أن ننتمي لهكذا أوطان ... لكن ... ربما العار أن نكون نحن أبناء لتلكم أوطان .. من يدري ؟!!

ليعلم أولئك ... إنّ الشعوب إنْ هي استيقظت تسحق ظُلامََهَا ...

There, even in dreams u r wanted

To be a programmer, how a nice dream it was

Leaving ...

أعيدوا لإسمي لونه المفضل

#3

السلام عليكم

بالنسبة لفتح my computer يمكن استخدام الكود الاتي

ShellExecute(0,'open','"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"',nil,nil,SW_NORMAL);

او باستخدام الكود المذكور في الاجابة السابقة

ExecNewProcess('explorer "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"'(;

"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" هو الـ GUID لـــ my computer يمكن ان يستعمل كـ pathname .

"::{645FF040-5081-101B-9F08-00AA002F954E}" للـــ recycle bin

للحصول على هذه الـ GUID يمكن البحث في الــ registry .

فتح الـ drivers يمكن ان يتم بالطريقة الاتية

ShellExecute(0,'open','c:',nil,nil,SW_NORMAL);

ان لم يكن هذا هو المطلوب ارجو توضيح السؤال :) .

في امان الله

هناك حتى الأحلام أصبحت ممنوعة ...

إنه لعار أن ننتمي لهكذا أوطان ... لكن ... ربما العار أن نكون نحن أبناء لتلكم أوطان .. من يدري ؟!!

ليعلم أولئك ... إنّ الشعوب إنْ هي استيقظت تسحق ظُلامََهَا ...

There, even in dreams u r wanted

To be a programmer, how a nice dream it was

Leaving ...

أعيدوا لإسمي لونه المفضل

#4

أخي العزيز tmaaa : هذا ماقصدته بالضبط

ولكن الكود الخاص بفتح السواقات (c...) يظهر لي خطأ على الكلمة ShellExecute فماذا أفعل

وشكراً جزيلاً لك .

#5

السلام عليكم

الدالة موجودة في shelllapi unit

اضف

 uses shellapi;

تحياتي

هناك حتى الأحلام أصبحت ممنوعة ...

إنه لعار أن ننتمي لهكذا أوطان ... لكن ... ربما العار أن نكون نحن أبناء لتلكم أوطان .. من يدري ؟!!

ليعلم أولئك ... إنّ الشعوب إنْ هي استيقظت تسحق ظُلامََهَا ...

There, even in dreams u r wanted

To be a programmer, how a nice dream it was

Leaving ...

أعيدوا لإسمي لونه المفضل

هذا الموضوع مغلق.

مواضيع مشابهة