home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / misc / 3574 < prev    next >
Encoding:
Text File  |  1992-11-20  |  7.3 KB  |  173 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!usenet
  3. From: simon@wotangate.sc.ti.com (Jean-Yves Simon)
  4. Subject: Problem when running with windows 3.1
  5. Message-ID: <1992Nov20.014908.15451@csc.ti.com>
  6. Sender: usenet@csc.ti.com
  7. Nntp-Posting-Host: 192.91.134.11
  8. Organization: Texas Instruments
  9. Date: Fri, 20 Nov 1992 01:49:08 GMT
  10. Lines: 161
  11.  
  12. Hi netters !
  13.  
  14. I own tpw 1.5 and I have a problem when i run a program I wrote with
  15. tpw 1.5 . I want the user to be able to modify the attributes of a file, 
  16. for that I have a list box where I show the files in the current 
  17. directory , plus 4 checks boxes for the files attributes 
  18. (hidden, archive..). The list box shows the files and the directories,
  19. and when I double click,I change for the selected directoty and show 
  20. the files, otherwise, if I select a file, I am showing its attributes, 
  21.  
  22. Here is my procedure.
  23.  
  24.  
  25. (*** proc to handle list box ***)
  26. procedure TFileWindow.HandlelistBox(var Msg : Tmessage);
  27. var path,curdir ,t1: array [0..164] of char;
  28.     Is_a_dir : Boolean;
  29. begin
  30.  if ((Msg.LParamHi = lbn_SelChange) or (Msg.LparamHi = lbn_Dblclk)) then begin
  31.      Is_a_dir := DlgDirSelect(Hwindow,path,id_listb);
  32.      if (Is_a_dir = FALSE) then begin
  33.                    EnableWindow(GetDlgItem(Hwindow,id_modbut),TRUE);
  34.                    EnableWindow(GetDlgItem(Hwindow,id_info),TRUE);
  35.                    TFileWindow.EnableAttributes;
  36.                    ListB^.GetSelString(t1,14);
  37.                    StaticLin^.SetText(t1);
  38.                    getcurdir(curdir,0);
  39.                    if ( (strlen(curdir)=3) and (StrScan(curdir,':')<>nil)) then strcat(curdir,'') else strcat(curdir,'\');
  40.                    strcat(curdir,path);
  41.                    strcopy(File_to,curdir);
  42.                    TFileWindow.ShowAttributes;
  43.                                  end
  44.      else begin
  45.           StaticLin^.SetText('');
  46.           EnableWindow(GetDlgItem(Hwindow,id_modbut),FALSE);
  47.           EnableWindow(GetDlgItem(Hwindow,id_info),FALSE);
  48.           TFileWindow.DisableAttributes;
  49.           end;
  50.  
  51.  if ( (Msg.LparamHi = lbn_Dblclk)) then begin
  52.       if (Is_a_dir = TRUE) then begin
  53.            if ( (strlen(path)=2) and (StrScan(path,':')<>nil)) then begin
  54.                                               Strcopy(curdir,'');
  55.                                               strcat(curdir,path);
  56.                                               strcat(curdir,Mask);
  57.                                               end
  58.            else begin
  59.                          getcurdir(curdir,0);
  60.                          if ((strlen(curdir)=3)and(StrScan(curdir,':')<>nil)) then StrCat(curdir,'') else StrCat(curdir,'\');
  61.                          StrCat(curdir,path);
  62.                          strcat(curdir,Mask);
  63.                 end;
  64.            DlgDirlist(Hwindow,curdir,id_listb,id_dir, $6037);
  65.            SetFocus(GetDlgItem(Hwindow,id_listb));
  66.    end ;
  67.  end;
  68. end;
  69. end;
  70.  
  71.  
  72. (*** end of proc ***)
  73.  
  74. This is working fine with win 3.00, However, when I use this program 
  75. with win3.1, I can't have the list box to display files. When I start 
  76. the program, I can see the files, but after moving back and forth 
  77. throught directories, the files are not displayed, I can see only 
  78. the directories.
  79.  
  80. I looked at my code with winsight , here is what I get:
  81. This is an extract of the log with WINDOWS 3.0
  82.  
  83.  27DC {ListBox}  LB_GETTEXT  Sent from 2618 Index 43 at 0C05:26B4
  84.  27DC {ListBox}  LB_GETTEXT  Returns "[..]"
  85.  27DC {ListBox}  LB_GETCURSEL  Sent from 2618
  86.  27DC {ListBox}  LB_GETCURSEL  Returns 43 0000:002B
  87.  27DC {ListBox}  LB_GETTEXT  Sent from 2618 Index 43 at 0C05:2684
  88.  27DC {ListBox}  LB_GETTEXT  Returns "[..]"
  89.  27DC {ListBox}  LB_GETCURSEL  Sent from 2618
  90.  27DC {ListBox}  LB_GETCURSEL  Returns 43 0000:002B
  91.  27DC {ListBox}  LB_GETTEXT  Sent from 2618 Index 43 at 0C05:2684
  92.  27DC {ListBox}  LB_GETTEXT  Returns "[..]"
  93. 27DC {ListBox}  LB_RESETCONTENT  Dispatched
  94. 27DC {ListBox}  LB_DIR  Dispatched Attrib 0027 "*.*"
  95. 27DC {ListBox}  WM_PAINT  Sent  (0,0)-(128,128)
  96.  27DC {ListBox}  WM_ERASEBKGND  Sent from self  hdc 0836
  97.  27DC {ListBox}  WM_ERASEBKGND  Returns Erased
  98. 27DC {ListBox}  WM_PAINT  Returns 1
  99. 27DC {ListBox}  LB_DIR  Dispatched Attrib C010 "*.*"
  100. 27DC {ListBox}  WM_PAINT  Sent  (0,0)-(128,128)
  101.  27DC {ListBox}  WM_ERASEBKGND  Sent from self  hdc 084E
  102.  27DC {ListBox}  WM_ERASEBKGND  Returns Erased
  103. 27DC {ListBox}  LB_RESETCONTENT  Dispatched
  104.  
  105. .... some lines deleted ...
  106.  
  107. 27DC {ListBox}  LB_DIR  Dispatched Attrib 0027 "*.*"
  108. 27DC {ListBox}  WM_PAINT  Sent  (0,0)-(128,128)
  109.  27DC {ListBox}  WM_ERASEBKGND  Sent from self  hdc 0836
  110.  27DC {ListBox}  WM_ERASEBKGND  Returns Erased
  111. 27DC {ListBox}  WM_PAINT  Returns 1
  112. 27DC {ListBox}  LB_DIR  Dispatched Attrib C010 "*.*"
  113. 27DC {ListBox}  WM_PAINT  Sent  (0,0)-(128,128)
  114.  27DC {ListBox}  WM_ERASEBKGND  Sent from self  hdc 084E
  115.  27DC {ListBox}  WM_ERASEBKGND  Returns Erased
  116.  
  117.  
  118. In windows 3.1. I have the following
  119. -------------------------------------
  120.  
  121.  1BA8 {ListBox}  LB_GETTEXT  Sent from 1A54 Index 43 at 10A7:269C
  122.  1BA8 {ListBox}  LB_GETTEXT  Returns "[..]"
  123. 1BA8 {ListBox}  WM_NCHITTEST  Sent  (158,195)
  124. 1BA8 {ListBox}  WM_NCHITTEST  Returns in Client
  125.  1BA8 {ListBox}  LB_GETCURSEL  Sent from 1A54
  126.  1BA8 {ListBox}  LB_GETCURSEL  Returns 43 0000:002B
  127.  1BA8 {ListBox}  LB_GETTEXT  Sent from 1A54 Index 43 at 10A7:267A
  128.  1BA8 {ListBox}  LB_GETTEXT  Returns "[..]"
  129.  1BA8 {ListBox}  LB_GETCURSEL  Sent from 1A54
  130.  1BA8 {ListBox}  LB_GETCURSEL  Returns 43 0000:002B
  131.  1BA8 {ListBox}  LB_GETTEXT  Sent from 1A54 Index 43 at 10A7:267A
  132.  1BA8 {ListBox}  LB_GETTEXT  Returns "[..]"
  133. 1BA8 {ListBox}  LB_RESETCONTENT  Dispatched
  134. 1BA8 {ListBox}  WM_NCCALCSIZE  Sent  wp=0001!  (39,41)-(185,171)
  135. 1BA8 {ListBox}  WM_NCCALCSIZE  Returns 0
  136. 1BA8 {ListBox}  LB_DIR  Dispatched Attrib 0027 "@"     
  137. 1BA8 {ListBox}  LB_DIR  Dispatched Attrib C010 "*.*"     
  138.  
  139.  ... some lines deleted...
  140.  
  141.  1BA8 {ListBox}  LB_GETTEXT  Sent from 1A54 Index 1 at 10A7:269C
  142.  1BA8 {ListBox}  LB_GETTEXT  Returns "[applicat]"
  143. 1BA8 {ListBox}  WM_NCHITTEST  Sent  (186,144)
  144. 1BA8 {ListBox}  WM_NCHITTEST  Returns in Client
  145.  1BA8 {ListBox}  LB_GETCURSEL  Sent from 1A54
  146.  1BA8 {ListBox}  LB_GETCURSEL  Returns 1
  147.  1BA8 {ListBox}  LB_GETTEXT  Sent from 1A54 Index 1 at 10A7:267A
  148.  1BA8 {ListBox}  LB_GETTEXT  Returns "[applicat]"
  149.  1BA8 {ListBox}  LB_GETCURSEL  Sent from 1A54
  150.  1BA8 {ListBox}  LB_GETCURSEL  Returns 1
  151.  1BA8 {ListBox}  LB_GETTEXT  Sent from 1A54 Index 1 at 10A7:267A
  152.  1BA8 {ListBox}  LB_GETTEXT  Returns "[applicat]"
  153. 1BA8 {ListBox}  LB_RESETCONTENT  Dispatched
  154. 1BA8 {ListBox}  WM_NCCALCSIZE  Sent  wp=0001!  (39,41)-(185,171)
  155. 1BA8 {ListBox}  WM_NCCALCSIZE  Returns 0
  156. 1BA8 {ListBox}  LB_DIR  Dispatched Attrib 0027 "@"   
  157. 1BA8 {ListBox}  LB_DIR  Dispatched Attrib C010 "*.*"
  158. 1BA8 {ListBox}  WM_NCHITTEST  Sent  (186,144)
  159.  
  160. As you can see, The message LB_DIR for the files in not anymore "*.*",
  161. and I don't understand why. (Actually,the character inside the quotes looks like a
  162. black triangle,I edited an @ for the purpose of this message).
  163. The code is exactly the same. I try to compile my code with TPW v1.0, 
  164. I get the same result. Works fine with 3.00 but shows the same behaviour with 3.1.
  165.  
  166. Sorry for the lenght of my message, but if anybody can help to figure 
  167. out this problem, I'll appreciate that.
  168.  
  169. Thank you very much.
  170.  
  171. PS: I have the same behaviour on friend'pc .It is not only mine which fails.
  172.  
  173.