Jump to content

dmorand

Active Members
  • Posts

    44
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

dmorand's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks, I did search through the forums, but must have been looking for the wrong topics.
  2. I was being dumb, I got it working...but how do I close the new window without exiting my entire application? While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $QuitItem Exit Case $BagelItem Run('notepad \\isops\analysts\_Application_Launcher\bagel_list_v2.txt'); Case $ReleaseItem Run('notepad \\ISOPS\Analysts\_Application_Launcher\Application_Launcher_help.txt'); Case $AboutItem MsgBox(0,"About","Application Launcher - HealthAlliance Hospital" & @CRLF & "-------------------------------------------------------" & @CRLF & "Version: 2.0" & @CRLF & "Revision Date: 01/09/2009" & @CRLF & "Author: Douglas Morand" & @CRLF & @CRLF & "Email: dmorand@healthalliance.com") Case $NewItem $NewForm = GUICreate("Create New Application", 540, 140, 250, 175) $Group1 = GUICtrlCreateGroup("Application Details", 8, 8, 529, 129) $Combo1 = GUICtrlCreateCombo("Combo1", 104, 24, 169, 25) $Input1 = GUICtrlCreateInput("Description", 104, 48, 185, 21) GUICtrlCreateInput("Please copy the path needed to launch", 104, 72, 425, 21) $Create = GUICtrlCreateButton("Create", 160, 104, 65, 25, 0) $Cancel = GUICtrlCreateButton("Cancel", 232, 104, 65, 25, 0) $Please = GUICtrlCreateLabel("Application Group:", 16, 24, 91, 17) $Label1 = GUICtrlCreateLabel("Description:", 40, 48, 60, 17) $Label2 = GUICtrlCreateLabel("Path:", 72, 72, 29, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $subMsg = GUIGetMsg() Switch $subMsg Case $Cancel Case $Create MsgBox(0,"","Hello!!") EndSwitch WEnd GUISetState($Form1) case $appChoser $group_sel = GUICtrlRead($appChoser) _buildList($group_sel) Case $launch_app_btn _GetApplication() EndSwitch WEnd
  3. I have an application that I'm building, and I want to have another window open when the user selects "Create New" from a Menu. How do I manage the new window once it's open? I'm able to get the window open, but I can't figure out how to manage the new window. Here is a code snippet.... $ApplicationMenu = GUICtrlCreateMenu("Application") $NewItem = GUICtrlCreateMenuItem("Create New", $ApplicationMenu) $EditItem = GUICtrlCreateMenuItem("Edit Existing", $ApplicationMenu) $DeleteItem = GUICtrlCreateMenuItem("Delete", $ApplicationMenu) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $QuitItem Exit Case $BagelItem Run('notepad \\isops\analysts\_Application_Launcher\bagel_list_v2.txt'); Case $ReleaseItem Run('notepad \\ISOPS\Analysts\_Application_Launcher\Application_Launcher_help.txt'); Case $AboutItem Case $NewItem ;$FormNew = GUICreate("", 400, 200, 280, 160) $Form1_1 = GUICreate("Create New Application", 540, 140, 250, 175,"","",$Form1) $Group1 = GUICtrlCreateGroup("Application Details", 8, 8, 529, 129) $Combo1 = GUICtrlCreateCombo("Combo1", 104, 24, 169, 25) $Input1 = GUICtrlCreateInput("Description", 104, 48, 185, 21) GUICtrlCreateInput("Please copy the path needed to launch", 104, 72, 425, 21) $Create = GUICtrlCreateButton("Create", 160, 104, 65, 25, 0) $Cancel = GUICtrlCreateButton("Cancel", 232, 104, 65, 25, 0) $Please = GUICtrlCreateLabel("Application Group:", 16, 24, 91, 17) $Label1 = GUICtrlCreateLabel("Description:", 40, 48, 60, 17) $Label2 = GUICtrlCreateLabel("Path:", 72, 72, 29, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) case $appChoser $group_sel = GUICtrlRead($appChoser) _buildList($group_sel) Case $launch_app_btn _GetApplication() EndSwitch WEnd I tried putting the GUIGetMsg() logic after my GUISetState(@SW_SHOW) statement, but that didn't allow for me to read the form controls.
  4. I read your reply, but when I click on an item in a different list, I'm still getting a value returned from the GuiCtrlRead(GuiCtrlRead($applist)). It's like it keeps track of the item I clicked on in that list, or any list. Is there a way to clear out the item selected from the list?
  5. The problem I'm having is that I've got 3 the listviews but it's not taking into account what is the current listviewitem I've selected. $selApp = GuiCtrlRead($applist) $selWeb = GuiCtrlRead($weblist) $selSupp = GuiCtrlRead($supplist) Example: I click on an item in $appList, and when I call GuiCtrlRead($appList) I get the element number of the item I selected. If I then click on an item in $webList, but call GuiCtrlRead($appList) I still get a value.
  6. I'm trying to determine which listview I'm in when I click on the launch_app_btn because based on what listview I'm in I'll need to call a different function. I can't seem to figure out how to determine which one I've clicked on. Any help would be appreciated. Here is a code snippet: $launch_app_btn = GUICtrlCreateButton("Launch Application", ((725/2)-55),435,110,30) $app_group = GUICtrlCreateGroup("Stand Alone Applications", 4, 8, 705, 122) $appList= GUICtrlCreateListView("Application|Version|Location", 8, 22, 694, 100,$LVS_SORTASCENDING + $LVS_EX_CHECKBOXES) GUICtrlSendMsg($appList, $LVM_SETCOLUMNWIDTH, 0, 200) GUICtrlSendMsg($appList, $LVM_SETCOLUMNWIDTH, 2, 400) createListView($iniFile,$ini,$appList,"application") $web_group = GUICtrlCreateGroup("Web Applications", 4, 138, 705, 160) $webList= GUICtrlCreateListView("Application|Version|Address", 8, 152, 694, 138,$LVS_SORTASCENDING) GUICtrlSendMsg($webList, $LVM_SETCOLUMNWIDTH, 0, 200) GUICtrlSendMsg($webList, $LVM_SETCOLUMNWIDTH, 2, 400) createListView($iniFile,$ini,$webList,"web") $support_group = GUICtrlCreateGroup("Support Sites", 4, 308, 705, 122) $suppList= GUICtrlCreateListView("Application|Version|Address", 8, 322, 694, 100,$LVS_SORTASCENDING) GUICtrlSendMsg($suppList, $LVM_SETCOLUMNWIDTH, 0, 200) GUICtrlSendMsg($suppList, $LVM_SETCOLUMNWIDTH, 2, 400) createListView($iniFile,$ini,$suppList,"support") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $QuitItem Exit Case $BagelItem Run('notepad \\isops\analysts\_Application_Launcher\bagel_list_v2.txt'); Case $ReleaseItem Run('notepad \\ISOPS\Analysts\_Application_Launcher\Application_Launcher_help.txt'); Case $AboutItem Case $launch_app_btn _GetApplication() EndSwitch WEnd
  7. I'm having some issues determining that the listview is being selected. I have multiple items being placed in my listview from an ini file. I have a case statement checking if the listview was clicked, but it seems to only work on the column headers, not the items themselves. I'm assuming I need to have a case for each item, is that right? $ini = "\\isops\analysts\_Application_Launcher\" & "launcher.ini" $iniFile = readIniSections($ini) func readIniSections($ini) $iniFile = IniReadSectionNames($ini) If @error Then MsgBox(4096, "", "Error occurred, probably no INI file, or has been renamed.") Exit EndIf Return $iniFile EndFunc func createListView($iniFile,$ini,$appList,$formGroup) For $i = 1 to $iniFile[0] $desc = IniRead($ini,$iniFile[$i],"description","NotFound") $location = IniRead($ini,$iniFile[$i],"run","NotFound") $group = IniRead($ini,$iniFile[$i],"group","NotFound") If $group=$formGroup Then GUICtrlCreateListViewItem($desc & "|N/A" & "|" & $location, $appList) EndIf Next EndFunc $Form1 = GUICreate("Application Launcher - HealthAlliance Hospital", 725, 450, 192, 114) $FileMenu = GUICtrlCreateMenu("File") $QuitItem = GUICtrlCreateMenuItem("Quit", $FileMenu) $MiscMenu= GUICtrlCreateMenu("Miscellaneous") $BagelItem = GUICtrlCreateMenuItem("Bagel List", $MiscMenu) $HelpMenu = GUICtrlCreateMenu("Help") $ReleaseItem = GUICtrlCreateMenuItem("Release Notes", $HelpMenu) $AboutItem = GUICtrlCreateMenuItem("About", $HelpMenu) $web_group = GUICtrlCreateGroup("Web Applications", 4, 134, 705, 160) $webList= GUICtrlCreateListView("Application|Version|Address", 8, 150, 694, 138,$LVS_SORTASCENDING) GUICtrlSendMsg($webList, $LVM_SETCOLUMNWIDTH, 0, 200) GUICtrlSendMsg($webList, $LVM_SETCOLUMNWIDTH, 2, 410) createListView($iniFile,$ini,$webList,"web") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $QuitItem Exit Case $BagelItem Run('notepad \\isops\analysts\_Application_Launcher\bagel_list_v2.txt'); Case $ReleaseItem Run('notepad \\ISOPS\Analysts\_Application_Launcher\Application_Launcher_help.txt'); [b] Case $webList MsgBox(0,"Hello","Testing") $app_run = GUICtrlGetState($webList) MsgBox(0,"",$app_run) $app_run = GUICtrlRead(GuiCtrlRead($webList)) MsgBox(0,"",$app_run)[/b] EndSwitch WEnd
  8. Was that in the documentation anywhere? I must have missed it if it was.
  9. I'm trying to set the column width of my ListView items so that users don't need to click on the columns to expand them. Here is the code snipped: $appList= GUICtrlCreateListView("Application|Version|Location|", 2, 2, 694, 268) GUICtrlSendMsg($appList, $LVM_SETCOLUMNWIDTH, 0, 70) Here are the messages I'm seeing: \\appserver\DS_DM\Custom_Scripts\applauncher_v20.au3(47,45) : WARNING: $LVM_SETCOLUMNWIDTH: possibly used before declaration. GUICtrlSendMsg($appList, $LVM_SETCOLUMNWIDTH, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ \\appserver\DS_DM\Custom_Scripts\applauncher_v20.au3(47,45) : ERROR: $LVM_SETCOLUMNWIDTH: undeclared global variable. GUICtrlSendMsg($appList, $LVM_SETCOLUMNWIDTH, I didn't think I needed to declare the style variables........
  10. Thanks a bunch!!! Your logic made perfect sense. I was being an idiot (which I figured) and was trying to assign my search handles to an array when I didn't nead to at all.
  11. I cant' seem to manage the search handles. I need to keep opening new handles when I go into a new folder, but I don't know how to make new variable names.
  12. Thanks but doesn't that basically do what _FileListToArray() does? I can traverse through sub folders, but I can't seem to get back up to the main folder after going through 1 set of sub-folders.
  13. I have a script I'm working on and I need to read files, but I want to pass the script a starting folder, and then read all the files in that folder, and any sub folder. I'm having problems with how to get to the sub folders properly. Does anyone have a suggestion?
  14. It started working again, not sure why but it did.
  15. This is the code I'm running. When I compile this to an exe I'm running it like this: script.exe "dmorand" "postOfficeBox" "9045" That's correct right?
×
×
  • Create New...